lua-users home
lua-l archive

Re: udp socket server question

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


On 2003年8月31日 11:21:13 -0700
"Vijay Aswadhati" <wyseman@pacbell.net> wrote:
> Sound familiar to a bug reported by me sometime ago. Lookup
> http://lua-users.org/lists/lua-l/2003-08/msg00113.html
> and see if it is related. 
Indeed it is. I made the changes suggested in the message you
referenced and echosrvr.lua works now.
Thank you very much,
Steve
 
> > -----Original Message-----
> > From: lua-bounces@bazar2.conectiva.com.br
> > [mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of Steve Elkins
> > Sent: Sunday, August 31, 2003 8:49 AM
> > To: lua@bazar2.conectiva.com.br
> > Subject: udp socket server question
> > 
> > 
> > I'm looking at the lua socket implementation (2.0 alpha) from 
> > 
> > http://www.tecgraf.puc-rio.br/~diego/luasocket/
> > 
> > I realize the examples/ code is unsupported by Diego (so the README in
> > examples/ says) so I wonder if anyone on the list has the echosrvr.lua
> > example working. It goes like this for me...
> > 
> > sge:72$ lua -lsocket echosrvr.lua 127.0.0.1 8933 
> > 
> > Binding to host '127.0.0.1' and port 8933...
> > lua: echosrvr.lua:16: calling `setsockname' on bad self 
> > (udp{master} expected)
> > stack traceback:
> > [C]: in function `setsockname'
> > echosrvr.lua:16: in main chunk
> > [C]: ?
> > sge:73$
> > 
> > After argument processing the script gets into trouble executing the
> > 3rd line of the 4 below...
> > 
> > udp, err = socket.udp()
> > if not udp then print(err) os.exit() end
> > err = udp:setsockname(host, port)
> > if err then print(err) os.exit() end
> > 
> > If this isn't the right way to bind a udp socket to a host and port,
> > would someone please tell me what is?
> > 
> > Thanks,
> > Steve
> > 
> > 
> 

AltStyle によって変換されたページ (->オリジナル) /