修改后的socketsvr源码 function TCustomWinSocket.ReceiveBuf(var Buf; Count: Integer): Integer; var ErrorCode, iCount: Integer; {##Add} begin Lock; try Result := 0; if (Count = -1) and FConnected then ioctlsocket(FSocket, FIONREAD, Longint(Result)) else begin if not FConnected