C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[54122] Indy 9에서 TCPclinet에 timer 적용 시 계속 에러가 발생합니다.
기둥 [] 1922 읽음    2008-07-28 11:29
안녕하세요.
아직도 볼란드가 무척이나 무서운 왕 초보 기둥입니다.

Indy9을 이용하여 tcp로 server와 client를 연결하였습니다.
client에서 주기적으로 정수형 데이터를 sever로 보내려고 해서
기본 timer를 이용했습니다.
주기를 3000 ms로 하고
정수 10개를 보내는 코드를 작성하였는데,
연결된 이후에
첫 번째 주기에서 socket error가 발생합니다.

client code:
void __fastcall TForm2::Button1Click(TObject *Sender)
{

    IdTCPClient1->Connect();
    int i;
    i=10;
    IdTCPClient1->WriteInteger(i,true);
   
//---------------------------------------------------------------------------

void __fastcall TForm2::Timer1Timer(TObject *Sender)
{
    int i;
    if (IdTCPClient1->Connected()==true) {
        for (i = 0; i <= 10; i++) {
            IdTCPClient1->WriteInteger(i,true);
        }
    }
}

server code:
void __fastcall TForm2::IdTCPServer1Connect(TIdPeerThread *AThread)
{
    int n;
    n=AThread->Connection->ReadInteger();
    Memo1->Lines->Add(n);

}

error code:
client 쪽:
First chance exception at $7C812A7B. Exception class EIdSocketError with message 'Socket Error # 10053
Software caused connection abort.'. Process Client_timer.exe (1456)
server 쪽:
First chance exception at $7C812A7B. Exception class EIdNoExecuteSpecified with message 'No execute handler found.'. Process Sever_timer.exe (1888)

여러 고수님의 많은 지도 기다리고 있습니다.
감사합니다.

+ -

관련 글 리스트
54122 Indy 9에서 TCPclinet에 timer 적용 시 계속 에러가 발생합니다. 기둥 1922 2008/07/28
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.