[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua sockets and source port
- From: Sam Roberts <vieuxtech@...>
- Date: Mon, 11 May 2009 16:33:22 -0700
On Mon, May 11, 2009 at 12:04 PM, Jorge <xxopxe@gmail.com> wrote:
> I stumbled upon a peculiarity in LuaSocket library: i can not specify a
> source address for a socket (the signature for the connect command is
> master:connect(address, port)). Meanwhile, there seems to exist that
> possibility when using the shortcut socket.connect(address, port [,
> locaddr, locport]).
% lua -lsocket
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
> s=socket.tcp()
> s:bind("*", 8765)
> = s:connect("localhost", 8080)
1
>
netstat -n -p:
tcp 0 0 127.0.0.1:8765 127.0.0.1:8080
ESTABLISHED20670/lua
Cheers,
Sam