Write an OnError event handler to respond to errors that arise with the socket connection. Set the ErrorCode parameter to 0 if the OnError event handler successfully deals with the error condition, to prevent an ESocketError from being raised.照你的话和帮助来看,你是会出现错误代码,只需要将 ErrorCode 设为0就行了。procedure TForm1.ClientSocket1Error(Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer); begin ErrorCode := 0; Socket.Close; end;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
begin
ErrorCode := 0;
Socket.Close;
end;
Socket.Active:=false;
DeleteStudentLoginINRemost(Socket.RemoteHost);//清除数据
ErrorCode:=0;
StatusBar1.Panels.Items[0].Text: = "继续....";
List_info.Items.Add(Socket.RemoteHost+"退出");
ServerSocket.Close();
Disconnect1Click(NULL);//断开连接,重新监测
---------------------------------------------------------------------------------
有一个典故:画一个圈1美元,在什么地方画圈9999美元!!散分