bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

socket examples say INADDR_LOCALHOST rather than INADDR_LOOPBACK


From: Scott McPeak
Subject: socket examples say INADDR_LOCALHOST rather than INADDR_LOOPBACK
Date: Tue, 29 Sep 2009 17:30:35 -0700
User-agent: Thunderbird 2.0.0.18 (X11/20081113)

In the documentation for Guile's 'connect' call:

http://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Network-Sockets-and-Communication.html

it gives examples:

  (connect sock AF_INET INADDR_LOCALHOST 23)
  (connect sock (make-socket-address AF_INET INADDR_LOCALHOST 23))

However, the correct address is INADDR_LOOPBACK, not INADDR_LOCALHOST. The former is not defined:

guile> (inet-ntoa INADDR_LOOPBACK)
"127.0.0.1"
guile> (inet-ntoa INADDR_LOCALHOST)
[...]
ABORT: (unbound-variable)

-Scott




reply via email to

[Prev in Thread] Current Thread [Next in Thread]