From: Vadim Zeitlin Date: Sat, 9 Jun 2007 11:05:35 +0000 (+0000) Subject: generate disconnection event if recv() returns 0 in Detected_Read() (patch 1730589) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e37e082ef25916942b71ef4b3a857a35aece8f94 generate disconnection event if recv() returns 0 in Detected_Read() (patch 1730589) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/unix/gsocket.cpp b/src/unix/gsocket.cpp index 659f709be5..e2423cdd2c 100644 --- a/src/unix/gsocket.cpp +++ b/src/unix/gsocket.cpp @@ -1751,6 +1751,12 @@ void GSocket::Detected_Read() { CALL_CALLBACK(this, GSOCK_CONNECTION); } + else if (num == 0) + { + /* graceful shutdown */ + CALL_CALLBACK(this, GSOCK_LOST); + Shutdown(); + } else { /* Do not throw a lost event in cases where the socket isn't really lost */