[plt-scheme] instaweb, #:listen-ip

From: Geoffrey S. Knauth (geoff at knauth.org)
Date: Sun Jan 6 23:41:02 EST 2008

Noel,

I tried instaweb on a VPS I just set up at slicehost.  (I'm trying to  
write up some Ubuntu quick-start instructions.)

I found that if I tried to use the #:listen-ip parameter, the listen  
failed, errno=99.

#define ENOSTR		99		/* Not a STREAM */

The ipaddr 11.22.33.44 below is contrived.  In real life it was the  
[comcast.net] ipaddr from which my web request would have been coming.

Neat stuff, instaweb.

Geoffrey

$ mzscheme
Welcome to MzScheme v372 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
 > (require (planet "instaweb.ss" ("schematics" "instaweb.plt" 2 2)))
 > (instaweb)
Web server started on port 8765
Listening on IP address: 127.0.0.1
Type stop to stop the server and exit
Type restart to restart the server
stop
 > (instaweb-here #:servlet-path
        (string-append "/usr/local/plt/lib/plt/collects/"
         "web-server/default-web-root/servlets/examples/"
         "hello.ss")
#:listen-ip "11.22.33.44")
Web server started on port 8765
Listening on IP address: 11.22.33.44
Type stop to stop the server and exit
Type restart to restart the server
tcp-listen: listen on 8765 failed (Cannot assign requested address;  
errno=99)
stop
 > (instaweb-here
  #:servlet-path
  (string-append "/usr/local/plt/lib/plt/collects/"
  "web-server/default-web-root/servlets/examples/"
  "hello.ss")
  #:port 5679
  #:listen-ip "11.22.33.44")
Web server started on port 5679
Listening on IP address: 11.22.33.44
Type stop to stop the server and exit
Type restart to restart the server
tcp-listen: listen on 5679 failed (Cannot assign requested address;  
errno=99)

HOWEVER, THIS WORKED FINE:

(instaweb-here
  #:servlet-path
  (string-append "/usr/local/plt/lib/plt/collects/"
  "web-server/default-web-root/servlets/examples/"
  "hello.ss")
  #:port 5679
  #:listen-ip #f)




Posted on the users mailing list.