ret = m_o_socket->Write((const char *)buffer, size).LastCount();
- if (ret > 0)
- m_lasterror = wxStream_NOERROR;
+ if (m_o_socket->Error())
+ m_lasterror = wxStream_WRITE_ERR;
else
- m_lasterror = wxStream_READ_ERR;
+ m_lasterror = wxStream_NOERROR;
return ret;
ret = m_i_socket->Read((char *)buffer, size).LastCount();
- if (ret > 0)
- m_lasterror = wxStream_NOERROR;
- else
+ if (m_i_socket->Error())
m_lasterror = wxStream_READ_ERR;
+ else
+ m_lasterror = wxStream_NOERROR;
return ret;
}