[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaSocket: Rationale behind address arg in socket.bind
- From: "Andreas Falkenhahn" <andreas@...>
- Date: Mon, 12 Apr 2010 16:38:09 +0200
On 12.04.2010 at 09:28 Javier Guerra Giraldez wrote:
>2010/4/12 Andreas Falkenhahn <andreas@airsoftsoftwair.de>:
>> I can't imagine a case
>> where I'd need to set this to a different address than 127.0.0.1 but
>then again, I'm
>> just starting out with LuaSocket (& sockets in general)....
>
>
>au contraire, if you only bind to 127.0.0.1, the socket won't go to
>the network; only to the local loopback 'interface'. IOW, it wouldn't
>be accessible by other machine.
>
>the default is '*', meaning 'all IP addresses held by this machine'
Ah, okay, thanks for clearing this up :)
But the LuaSocket docs don't say that '*' is the default. In fact, the address
argument is listed as mandatory. That is why I was under the impression
that the address argument is something that will differ from case to case.
But obviously, this is not the case. 90% of the users will probably use
'*' as address then. So it would probably be wise to either make the
address argument optional (with a default fallback to '*') or mention in the
bind docs something like:
"Normally you will want to use '*' as address"
Just my 2 cents :)
Andreas
--
"Remember: It's nice to be important but it's more important to be nice!"