---------------------------------------------------------------------------
| 298 | } |
| 299 | //--------------------------------------------------------------------------- |
| 300 | bool TUDP::Write(void * data, int size) |
| 301 | { |
| 302 | WSAError = 0; |
| 303 | Error = 0; |
| 304 | |
| 305 | if( !handle ) |
| 306 | { |
| 307 | WSAError = MYERROR_UNKNOWNPARAMS; |
| 308 | Error = 1; |
| 309 | if( Exceptions ) throw 0; |
| 310 | return !Error; |
| 311 | } |
| 312 | |
| 313 | int rv = send(handle, (char *)data, size, 0); |
| 314 | if( rv == SOCKET_ERROR ) |
| 315 | { |
| 316 | WSAError = WSAGetLastError(); |
| 317 | Error = 2; |
| 318 | if( Exceptions ) throw 0; |
| 319 | return !Error; |
| 320 | } |
| 321 | if( rv != size ) |
| 322 | { |
| 323 | WSAError = WSAGetLastError(); |
| 324 | Error = 3; |
| 325 | if( Exceptions ) throw 0; |
| 326 | return !Error; |
| 327 | } |
| 328 | OutBytes += size; |
| 329 | return ! Error; |
| 330 | } |
| 331 | //--------------------------------------------------------------------------- |
| 332 | bool TUDP::Read(void * data, int size, bool bPeek) |
| 333 | { |
nothing calls this directly
no outgoing calls
no test coverage detected