 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Greg102 Guest
|
Posted: Thu Dec 29, 2005 8:30 am Post subject: TClientSocket and reconnect? |
|
|
Hi
I would like to implement function reconnect in TClientSocket.
If server doesn't exists try connect again.
But every time after ClientSocket1.Open; I got new LocalPort.
I want use one and the same LocalPort during reconnect.
Is it possible?!
procedure TForm1.Button1Click(Sender: TObject);
begin
Test := 0;
ClientSocket1.Host := Edit1.Text;
ClientSocket1.Port := StrToInt(Edit2.Text);
ClientSocket1.Open;
end;
procedure TForm1.ClientSocket1Error(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
var localport : integer;
begin
localport := ClientSocket1.Socket.LocalPort;
ClientSocket1.Open;
ErrorCode := 0;
end;
Thanks in advance,
Greg
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|