| 317 | } |
| 318 | |
| 319 | uint32_t SocketImpl::read(uint8_t* data, uint32_t length) |
| 320 | { |
| 321 | if(length == 0) |
| 322 | return 0; |
| 323 | |
| 324 | int32_t received = recv(mSocket, reinterpret_cast<char*>(data), int32_t(length), 0); |
| 325 | |
| 326 | if(received <= 0 && !nonBlockingTimeout()) |
| 327 | disconnect(); |
| 328 | |
| 329 | return uint32_t(received > 0 ? received : 0); |
| 330 | } |
| 331 | |
| 332 | class BufferedSocketImpl : public SocketImpl |
| 333 | { |