->이렇게 두 분이나 답변달아 주셔서 감사합니다^^*
그런데 'Indy 소스 코드'를 보라는 말씀과 'IDE에서 실행할 경우'라는 말이 잘 이해가 가지 않습니다.
답변 부탁드립니다.^^*
civilian 님이 쓰신 글 :
: Indy소스 코드를 보면 IDE에서 실행할 경우 Exception이 발생되도록 되어있습니다.
:
: 초코파이 님이 쓰신 글 :
: : ->델파이에서 프로그램을 실행시에 서버에 접속했다가 프로그램 종료시에 에러메세지가 나타납니다.
: : 실행파일을 직접 실행시에는 나타나지 않습니다.
: : 왜 에러메세지가 뜨는 건가요? 제발 부탁드립니다.(무플은 이제 그만요...ㅠ.ㅠ)
: :
: : 초코파이 님이 쓰신 글 :
: : : implementation
: : :
: : : {$R *.dfm}
: : :
: : : uses Setting;
: : :
: : : procedure TMyThread.Execute;
: : : begin
: : : inherited;
: : : while not Terminated do begin
: : : try
: : : Msg := frClient.TCPClient.ReadLn;
: : : Synchronize(View);
: : : except
: : : Terminate;
: : : end;
: : : end;
: : : end;
: : :
: : : procedure TMyThread.View;
: : : begin
: : : frClient.Memo.Lines.Add(Msg);
: : : end;
: : :
: : : procedure TfrClient.Edit2KeyPress(Sender: TObject; var Key: Char);
: : : begin
: : : if Key = #13 then begin
: : : TCPClient.WriteLn(Edit1.Text + ' : ' + Edit2.Text);
: : : Edit2.Text := '';
: : : Key := #0;
: : : end;
: : : end;
: : :
: : : procedure TfrClient.TCPClientConnected(Sender: TObject);
: : : begin
: : : Memo.Lines.Add('서버와 접속되었습니다');
: : : end;
: : :
: : : procedure TfrClient.TCPClientDisconnected(Sender: TObject);
: : : begin
: : : Memo.Lines.Add('서버와 접속해재 되었습니다');
: : : end;
: : :
: : : procedure TfrClient.ConfigClick(Sender: TObject);
: : : begin
: : : if frSetting = nil then
: : : frSetting := TfrSetting.Create( Self );
: : :
: : : frSetting.ShowModal;
: : : end;
: : :
: : : procedure TfrClient.btConnectClick(Sender: TObject);
: : : begin
: : : if Edit1.Text = '' then begin
: : : ShowMessage('대화명을 입력하세요');
: : : Edit1.SetFocus;
: : : exit;
: : : end;
: : :
: : : if (frSetting.ePort.Text = '0') Or (frSetting.eIP.Text = '0') then begin
: : : ShowMessage('서버접속 설정을 하세요.');
: : : exit;
: : : end;
: : :
: : : TCPClient.Port := StrtoInt(frSetting.ePort.Text);
: : : TCPClient.Connect;
: : : MyThread := TMyThread.Create(True);
: : : MyThread.FreeOnTerminate := True;
: : : MyThread.Resume;
: : :
: : : end;
: : :
: : :
: : : -> 폼이 종료 되거나 IndyTCPClient가 DisConnect되기만 하면 error가 뜹니다. 도와주세요~ ㅠ.ㅠ
: : : ps. 서버 쪽에서는 Client가 종료되면 broadcast로 메세지를 뿌려주는 것 말고는 Client에 보내지는게
: : : 없습니다
|