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

델파이 Q&A
Delphi Programming Q&A
[13501] Indy UDPServer 사용시....
주재환 [cyberjjh] 2210 읽음    2010-12-10 16:43
폼을 생성해서 컴포넌트 추가해서 하면 아주 작동이 잘 되는데....

일반 클래스 안에서 사용하고 싶은데... 메시지를 한번 밖에 받지 못하네요....

type
  TUDP = class
    udpServer: TIdUDPServer;
    procedure udpServerUDPRead(AThread: TIdUDPListenerThread; AData: TBytes;
      ABinding: TIdSocketHandle);
  public
    constructor Create;
  end;

implementation

constructor TUDP.Create;
begin
  udpServer := TIdUDPServer.Create(nil);

  udpServer.DefaultPort := 8888;
  udpServer.BroadcastEnabled := True;
  udpServer.BufferSize := 8192;
  udpServer.IPVersion := Id_IPv4;
  udpServer.OnUDPRead := udpServerUDPRead;
end;

procedure TUDP.udpServerUDPRead(AThread: TIdUDPListenerThread; AData: TBytes;
  ABinding: TIdSocketHandle);
begin
  // 코딩....
end;

udp메시지(브로드캐스트 메시지)를 3번 보냈는데도... udpServerUDPRead 이벤트를 한번 밖에 안타네요....
왜 그럴까요????
똑같은 코딩으로 Form에 컴포넌트 추가하면 잘 되는데용...ㅠㅠ

+ -

관련 글 리스트
13501 Indy UDPServer 사용시.... 주재환 2210 2010/12/10
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.