|
From: Ian P. <piu...@us...> - 2003-09-16 07:56:55
|
Update of /cvsroot/squeak/squeak/platforms/unix/plugins/SocketPlugin In directory sc8-pr-cvs1:/tmp/cvs-serv25703 Modified Files: sqUnixSocket.c Log Message: Detect other end closed in primSocketStatus. Index: sqUnixSocket.c =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/unix/plugins/SocketPlugin/sqUnixSocket.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sqUnixSocket.c 3 Sep 2003 18:10:44 -0000 1.11 --- sqUnixSocket.c 16 Sep 2003 07:56:51 -0000 1.12 *************** *** 37,41 **** /* Author: Ian...@in... * ! * Last edited: 2003-09-01 20:26:26 by piumarta on emilia.inria.fr * * Support for BSD-style "accept" primitives contributed by: --- 37,41 ---- /* Author: Ian...@in... * ! * Last edited: 2003-09-12 21:05:50 by piumarta on emilia.inria.fr * * Support for BSD-style "accept" primitives contributed by: *************** *** 589,592 **** --- 589,603 ---- interpreterProxy->success(false); return Invalid; + } + /* check for connection closed by peer */ + if (SOCKETSTATE(s) == Connected) + { + int fd= SOCKET(s); + int n= socketReadable(fd); + if (n < 0) + { + FPRINTF((stderr, "socketStatus(%d): detected other end closed\n", fd)); + SOCKETSTATE(s)= OtherEndClosed; + } } FPRINTF((stderr, "socketStatus(%d) -> %d\n", SOCKET(s), SOCKETSTATE(s))); |