Commit b4f3419a47ba418d57eb40650c954a66d0276f28
1 parent
039ac474
Exists in
master
and in
3 other branches
Quit properly when the socket is died
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/DDClientLibCpp/DD_client.cc
... | ... | @@ -268,7 +268,7 @@ int DD_Client::ReceiveFromNet(char *buf, int PacketSize) |
268 | 268 | int i = 0; |
269 | 269 | int cc = 0; |
270 | 270 | while(( (cc = recv(SocketID,buf+ CurLength,PacketSize - CurLength,0)) < 0) && (i < TRY)) i++; |
271 | - if(cc < 0) return -1; | |
271 | + if(cc <= 0) return -1; | |
272 | 272 | CurLength = CurLength + cc; |
273 | 273 | } while(CurLength < PacketSize); |
274 | 274 | return 1; | ... | ... |