lua-users home
lua-l archive

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


Okay... I spent a few minutes tracing things, but need some guidance...

It looks like the send() (in wsocket.c::sock_sendto()) fails with a
WSAEWOULDBLOCK error. Anyone savvy to why this is happening?

I can do the following to make things work:

s=socket.udp()
s:setpeername("10.3.64.36",13919)
s:send(string.char(160))

but that's inconvenient, and I don't think it works with broadcast datagrams.

Guidance appreciated!

Thanks for the wonderful community. I love Lua (anyone making bumper
stickers or t-shirts that say this?)

-joe

On Thu, 28 Oct 2004 12:59:18 -0400, Joseph Stewart
<joseph.stewart@gmail.com> wrote:
> Hello all,
> 
> I'm using luasocket-2.0-beta2 to send udp data. In prior versions, I
> could use the following piece of code to send data to a udp server:
> 
> s=socket.udp()
> s:sendto(string.char(160),"10.3.64.36",13919)
> 
> and this usage is even mentioned in the current documentation (i.e.
> "An UDP socket object is created by the socket.udp function. UDP
> sockets do not need to be connected before use. The method sendto can
> be used immediately after creation to send a datagram to IP address
> and port.")
> 
> When I do this with the window binary Diego provides on the luasocket
> page, the sendto() call fails with "Socket is not connected". I also
> build the code myself with MINGW and LCC-WIN32.
> 
> I've verified that the server is running, and also use the prior
> version with success.
> 
> I did a quick compile of this under linux and determined that it DOES
> work when build there. Might this be a problem with wsocket.c.
> 
> I don't mind digging deeper into this to fix it, but don't want to
> repeat work anyone has done.
> 
> On another topic, I have a luasocket makefile for building under the
> MSYS environment of MINGW if anyone is interested (or for inclusion
> into the source tarball).
> 
> --
> Person who say it cannot be done should not interrupt person doing it.
>  -- Chinese Proverb
> 


-- 
Person who say it cannot be done should not interrupt person doing it.
 -- Chinese Proverb