blob: bf694dae7823cf3e246cfb20b7e26df9892bf83d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
Index: src/unix/gsocket.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/unix/gsocket.cpp,v
retrieving revision 1.67.2.2
diff -u -r1.67.2.2 gsocket.cpp
--- src/unix/gsocket.cpp 2007/03/17 02:15:29 1.67.2.2
+++ src/unix/gsocket.cpp 2007/03/25 19:28:24
@@ -1168,17 +1168,16 @@
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)
{
- m_error = GSOCK_IOERR;
+ /* Make sure wxSOCKET_LOST event gets sent */
m_detected = GSOCK_LOST_FLAG;
- Close();
- // Signal an error for return
- return -1;
+ Detected_Read();
+ return 0;
}
else if (ret == -1)
{
|