---------------------------------------------------------------------------
| 71 | } |
| 72 | //--------------------------------------------------------------------------- |
| 73 | bool MSocket::Read(void * data, int size) |
| 74 | { |
| 75 | Error = 0; |
| 76 | if( !handle ) { Error = 1; if( Exceptions ) throw 0; return ! Error; } |
| 77 | |
| 78 | bytes = recv(handle, (char *)data, size, 0); |
| 79 | errcode = 0; |
| 80 | if( bytes==SOCKET_ERROR ) { errcode = WSAGetLastError(); Error = 4; } |
| 81 | if( bytes<=0 ) Error = 2; |
| 82 | if( bytes<size ) Error = 3; |
| 83 | if( Error ) |
| 84 | { |
| 85 | if( Exceptions ) throw 0; |
| 86 | } |
| 87 | else |
| 88 | { |
| 89 | InBytes += bytes; |
| 90 | } |
| 91 | return ! Error; |
| 92 | } |
| 93 | //--------------------------------------------------------------------------- |
| 94 | DWORD MSocket::ReadLength(void) |
| 95 | { |
nothing calls this directly
no outgoing calls
no test coverage detected