c++ - Handling windows socket error -
i retrieving data socket using following code
iresult = recv(socket,data_array,sizeof(data_array),0);
now documentation states if recv succefull return no. of bytes retrieved otherwise return error code. how check error code. mean if data retrieved same amount value of error code.
check this link more detail.
basically, when error occurs, socket_error
(-1) gets returned, , have call wsagetlasterror()
, or read errno
or other platform-specific equivalent, specific error code.
Comments
Post a Comment