- int ret = ::recv(priv->handle, buf, size, 0);
- if(ret<0)
- {
- if(errno==EAGAIN)
- return 0;
- else
- throw system_error("recv");
- }
- else if(ret==0 && !eof_flag)
+ size_t ret = check_sys_error(::recv(priv->handle, buf, size, 0), "recv");
+ if(ret==0 && !eof_flag)