看不明白啊,帮助文档说: OnDataAvailable: Is called when data is available from winsock. You have to receive all data in here. If you don't receive all data then it is called back immediately after it ends. This event is also called immediately after a connection. If your application has nothing to receive, then you must receive here and trow away, or assign nothing (nil) to this event.里面不是说一连接上就响应了吗,怎么就没反应呢?
OnDataAvailable: Is called when data is available from winsock. You have to receive all data in here. If you don't receive all data then it is called back immediately after it ends. This event is also called immediately after a connection. If your application has nothing to receive, then you must receive here and trow away, or assign nothing (nil) to this event.里面不是说一连接上就响应了吗,怎么就没反应呢?
procedure TForm6.WSocketServer1ClientConnect(Sender: TObject;
Client: TWSocketClient; Error: Word);
begin
Client.OnDataAvailable := OnDataAvailable;//事件处理过程 ...
end;