git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45170
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+All (Unix):
+
+- Handle socket shutdown by the peer correctly in wxSocket (Tim Kosse)
+
wxMSW:
- Corrected wxStaticBox label appearance when its foreground colour was set:
wxMSW:
- Corrected wxStaticBox label appearance when its foreground colour was set:
else
ret = Recv_Dgram(buffer, size);
else
ret = Recv_Dgram(buffer, size);
- /* If recv returned zero, then the connection is lost, and errno is not set.
+ /* If recv returned zero, then the connection has been gracefully closed.
* Otherwise, recv has returned an error (-1), in which case we have lost the
* socket only if errno does _not_ indicate that there may be more data to read.
*/
if (ret == 0)
{
* Otherwise, recv has returned an error (-1), in which case we have lost the
* socket only if errno does _not_ indicate that there may be more data to read.
*/
if (ret == 0)
{
+ /* Make sure wxSOCKET_LOST event gets sent and shut down the socket */
m_detected = GSOCK_LOST_FLAG;
m_detected = GSOCK_LOST_FLAG;
- Close();
- // Signal an error for return
- return -1;
+ Detected_Read();
+ return 0;