unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* socket examples say INADDR_LOCALHOST rather than INADDR_LOOPBACK
@ 2009-09-30  0:30 Scott McPeak
  2009-10-01 21:30 ` Neil Jerram
  0 siblings, 1 reply; 2+ messages in thread
From: Scott McPeak @ 2009-09-30  0:30 UTC (permalink / raw)
  To: bug-guile

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: socket examples say INADDR_LOCALHOST rather than INADDR_LOOPBACK
  2009-09-30  0:30 socket examples say INADDR_LOCALHOST rather than INADDR_LOOPBACK Scott McPeak
@ 2009-10-01 21:30 ` Neil Jerram
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Jerram @ 2009-10-01 21:30 UTC (permalink / raw)
  To: Scott McPeak; +Cc: bug-guile

Scott McPeak <smcpeak@coverity.com> writes:

> 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)

Thanks for the report, I've fixed these.

       Neil




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-01 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-30  0:30 socket examples say INADDR_LOCALHOST rather than INADDR_LOOPBACK Scott McPeak
2009-10-01 21:30 ` Neil Jerram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).