错误原因是:
WSAECONNABORTED
(10053)
Software caused connection abort.
因软件原因导致连接终止
An established connection was aborted by the software in your host machine, possibly due to a data transmission timeout or protocol error.
可能在你传输数据时对方突然断开。
解决:
在SERVER和CLIENT端:
procedure TForm1.ClientSocketError(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
begin
case ErrorCode of
10053:
begin
Socket.Close;
end;
end;
ErrorCode := 0;
end;
在执行ClientSocket关闭的时候,需要把他产生的Socket也关闭,如:
ClientSocket.Socket.Close;
ClientSocket.Close;
www.taoyou100.cn 淘友100 满意100,提供给您最信赖的网络购物享受。