风
风清云淡系明月
Unregistered / Unconfirmed
GUEST, unregistred user!
服务器端:
While Not Terminated And ClientSocket.Connected Do
Try
SocketStream := TWinSocketStream.Create(ClientSocket, 10000);
Try
FillChar(Data, SizeOf(Data), 0);
If SocketStream.Read(Data, SizeOf(Data)) = 0 Then
Begin
sleep(1);
ClientSocket.Close;
Terminate;
End;
RecText := Data;
If Length(RecText) > 2 Then
Delete(RecText, Pos(#13#10, RecText), 2); // Delete #13#10
If ClientSocket.Connected Then
Begin
...................
End;
Finally
SocketStream.Free;
End;
Except
HandleException;
End;
可是超时断开客户端连接,客户端报错:
asynchronous socket 错误 10053
怎样才能不报错?实在不行能不能用try except 让错误不显示?
While Not Terminated And ClientSocket.Connected Do
Try
SocketStream := TWinSocketStream.Create(ClientSocket, 10000);
Try
FillChar(Data, SizeOf(Data), 0);
If SocketStream.Read(Data, SizeOf(Data)) = 0 Then
Begin
sleep(1);
ClientSocket.Close;
Terminate;
End;
RecText := Data;
If Length(RecText) > 2 Then
Delete(RecText, Pos(#13#10, RecText), 2); // Delete #13#10
If ClientSocket.Connected Then
Begin
...................
End;
Finally
SocketStream.Free;
End;
Except
HandleException;
End;
可是超时断开客户端连接,客户端报错:
asynchronous socket 错误 10053
怎样才能不报错?实在不行能不能用try except 让错误不显示?