Subject: [clisp-list] socket-accept not interruptible and broken http inspect server on win32

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Mon Apr 15 04:06:04 2002

Hi,

Sam Steingold and I request the help of the MS-Windows experts among you:
1. SOCKET-ACCEPT seems not interruptible via ^C (server socket even seems broken afterwards).

2. inspect HTTP server doesn't seem to work (unrelated?)

Sourceforge Bugtracker:
http://sourceforge.net/tracker/index.php?func=detail&aid=542902&group_id=1355&atid=101355

Ad 2.: I get "could not open, connection reset" from the browser, most of the time. However, sometimes, Netscape 4.7 or MS-IE 5 get through and display something!
(setq sys::*inspect-debug* 5)
(inspect *package* :frontend :http)

Even then, using "Quit" link signals
A network error occurred while Netscape was receiving data. (Network Error: Connection reset by peer). Try Connecting again.

Ie5 says (in German): Site http://foo.telekom.de:3192/0/:s cannot be opened. The connection to the server was reset.

BTW, Arseny Slobodjuck recently posted the MS-Windows shutdown() Manpage. It says, which surprised me:
>To  assure  that  all  data is sent and received on a connected socket
>before  it  is  closed,  an  application  should use shutdown to close
>connection  before  calling  closesocket.  For  example, to initiate a
>graceful disconnect: [...]

Thanks,
	Jörg Höhle.

---

From: Sam Steingold <[email-masked]>
Date: Tue Apr 16 06:59:02 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] socket-accept not interruptible and broken http inspect server on win32"
> * Sent on Mon, 15 Apr 2002 13:04:56 +0200
> * Honorable "Hoehle, Joerg-Cyril" <[email-masked]> writes:
>

missed this.  please try the patch:

--- stream.d.~1.266.~	Sat Apr 13 14:42:07 2002
+++ stream.d	Tue Apr 16 09:56:35 2002
@@ -14119,6 +14115,9 @@
 #if defined(UNIX_BEOS) || defined(WIN32_NATIVE)
 local void low_close_socket (object stream, object handle) {
   begin_system_call();
+ #ifdef WIN32_NATIVE
+  if (shutdown(TheSocket(handle),SHUT_RDWR)) { SOCK_error(); }
+ #endif
   if (!( closesocket(TheSocket(handle)) ==0)) { SOCK_error(); }
   end_system_call();
 }

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
<http://www.palestine-central.com/> <http://www.mideasttruth.com/>
Modern man is the missing link between apes and human beings.