---------------------------------------------------------------------------
| 50 | } |
| 51 | //--------------------------------------------------------------------------- |
| 52 | bool MSocket::Write(void * data, int size) |
| 53 | { |
| 54 | Error = 0; |
| 55 | if( !handle ) { Error = 1; if( Exceptions ) throw 0; return ! Error; } |
| 56 | |
| 57 | bytes = send(handle, (char *)data, size, 0); |
| 58 | errcode = 0; |
| 59 | if( bytes==SOCKET_ERROR ) { errcode = WSAGetLastError(); Error = 4; } |
| 60 | if( bytes<=0 ) Error = 2; |
| 61 | if( bytes<size ) Error = 3; |
| 62 | if( Error ) |
| 63 | { |
| 64 | if( Exceptions ) throw 0; |
| 65 | } |
| 66 | else |
| 67 | { |
| 68 | OutBytes += size; |
| 69 | } |
| 70 | return ! Error; |
| 71 | } |
| 72 | //--------------------------------------------------------------------------- |
| 73 | bool MSocket::Read(void * data, int size) |
| 74 | { |
nothing calls this directly
no outgoing calls
no test coverage detected