L
li2
Unregistered / Unconfirmed
GUEST, unregistred user!
var
Form1: TForm1;
i_count:integer=0;
cs :array[0..100] of tClientSocket;
procedure TForm1.ServerSocket1ClientConnect(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
i:=i_count;
cs:=tClientSocket.Create (self);
cs.tag:=i_count;
i_count :=i_count+1;
memo1.Lines.add('host:'+ Socket .RemoteHost
+'port:'+inttostr(Socket .remoteport)
+'localport'+inttostr(Socket .localport));
cs.Port :=23;
cs.host :='134.103.64.131';
cs.ClientType :=ctNonBlocking;
cs.onread:=ClientSocket1 .onread;
cs.OnDisconnect :=ClientSocket1 .OnDisconnect ;
cs.Active :=true;
end;
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
for i:=0 to i_count do begin
if (ServerSocket1 .Socket .Connections .RemotePort =socket.remotePort )
and (ServerSocket1 .Socket .Connections .LocalHost =socket.localHost ) then
begin
break;
end;
end;
memo1.Lines .add(inttostr(socket.remoteport)+' '+socket.localHost);
memo1.Lines .add(inttostr(ServerSocket1 .Socket .Connections .RemotePort)+' '+
ServerSocket1 .Socket .Connections .LocalHost);
cs.Socket .SendText (Socket .ReceiveText );
end;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
i:=(sender as TClientSocket ).tag;
ServerSocket1 .Socket .Connections .SendText (Socket .ReceiveText );
end;
Form1: TForm1;
i_count:integer=0;
cs :array[0..100] of tClientSocket;
procedure TForm1.ServerSocket1ClientConnect(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
i:=i_count;
cs:=tClientSocket.Create (self);
cs.tag:=i_count;
i_count :=i_count+1;
memo1.Lines.add('host:'+ Socket .RemoteHost
+'port:'+inttostr(Socket .remoteport)
+'localport'+inttostr(Socket .localport));
cs.Port :=23;
cs.host :='134.103.64.131';
cs.ClientType :=ctNonBlocking;
cs.onread:=ClientSocket1 .onread;
cs.OnDisconnect :=ClientSocket1 .OnDisconnect ;
cs.Active :=true;
end;
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
for i:=0 to i_count do begin
if (ServerSocket1 .Socket .Connections .RemotePort =socket.remotePort )
and (ServerSocket1 .Socket .Connections .LocalHost =socket.localHost ) then
begin
break;
end;
end;
memo1.Lines .add(inttostr(socket.remoteport)+' '+socket.localHost);
memo1.Lines .add(inttostr(ServerSocket1 .Socket .Connections .RemotePort)+' '+
ServerSocket1 .Socket .Connections .LocalHost);
cs.Socket .SendText (Socket .ReceiveText );
end;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
i:=(sender as TClientSocket ).tag;
ServerSocket1 .Socket .Connections .SendText (Socket .ReceiveText );
end;