请问在下列程序中clientsocket是一个事件还是一个独立对象? ( 积分: 20 )

  • 主题发起人 主题发起人 snowtea
  • 开始时间 开始时间
S

snowtea

Unregistered / Unconfirmed
GUEST, unregistred user!
书上的程序里只用了tcpserver和tcpclient控件,但程序中出现了clientSocket,不知从何而来,请高人指点。
程序如下:
procedure TForm2.TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
var
s:string;
DataThread:TclientDatathread;
begin
datathread:=Tclientdatathread.create(true);
datathread.TargetList:=memoRec.Lines ;
atathread.ListBuffer.Add('Remote host:'+clientsocket.LookupHostName(clientsocket.RemoteHost)+'('+clientsocket.RemoteHost+')');
s:=clientsocket.Receiveln;
while s<>'' do
begin
datathread.ListBuffer.Add(s);
s:=clientsocket.Receiveln;
end;
datathread.ListBuffer.Add('====end of message====');
datathread.Resume ;
end;
 
书上的程序里只用了tcpserver和tcpclient控件,但程序中出现了clientSocket,不知从何而来,请高人指点。
程序如下:
procedure TForm2.TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
var
s:string;
DataThread:TclientDatathread;
begin
datathread:=Tclientdatathread.create(true);
datathread.TargetList:=memoRec.Lines ;
atathread.ListBuffer.Add('Remote host:'+clientsocket.LookupHostName(clientsocket.RemoteHost)+'('+clientsocket.RemoteHost+')');
s:=clientsocket.Receiveln;
while s<>'' do
begin
datathread.ListBuffer.Add(s);
s:=clientsocket.Receiveln;
end;
datathread.ListBuffer.Add('====end of message====');
datathread.Resume ;
end;
 
clientsocket是個控件.
 
但是我并没有使用clientsocket控件啊[?]
 
不好意思.沒看仔細.
procedure TForm2.TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
//ClientSocket是一個關於網絡的類.
 
明白了,谢谢。
 
后退
顶部