C++ Functions According to TCP

半腔热情 提交于 2019-12-01 14:32:46

On most systems, recv() transmit informations by two means : the return code and by setting the global variable errno.

To know what is returned/set in each case, you have to look at the exact API of the recv() function.

  • R1 (problem) : recv() returns SOCKET_ERROR (windows) or -1 (linux), then you look at the value from WSAGetLastError (windows) or errno (linux) for details
  • R2 (connexion closed) : I'm not sure, the API is unclear. Just try it out ;-)

Full doc :

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!