Euphoria
Ticket #182:
UDP Client demo crashes
-
Reported by
mattlewis
Aug 11, 2010
demo$ eui udp_client.ex
udp_client.ex:4
<0074>:: Errors resolving the following references:
udp_client.ex (4): SO_BROADCAST
sock:set_option(client, sock:SOL_SOCKET, SO_BROADCAST, 1)
Press Enter
Details
1. Comment by SPringle
Aug 11, 2010
It works on WINDOWS because the constants are all defined there. You need to edit the LINUX case in std/socket.e and for any OS you want to work with this program.
2. Comment by jimcbrown
Aug 11, 2010
The Linux constants for these are available online here:
http://lxr.free-electrons.com/source/include/asm-generic/socket.h
And some extra stuff here:
http://lxr.free-electrons.com/source/include/asm-generic/sockios.h
I am pretty sure we already had them in socket.e and I'm not sure why they would have been taken out..
3. Comment by SPringle
Aug 12, 2010
I added the constants to the .e file. I am able to syntax check it with :
euc -plat LINUX udp_client.ex
Matt, could you try this out?
4. Comment by jimcbrown
Aug 12, 2010
I think that maybe in Jeremy's original design, these constants would have been given an arbiturary value (say via an enum) that would have been identical accross all platforms. Then we'd have code that converted from EU_BROADCAST to the winsock value for SO_BROADCAST or the linux value for SO_BROADCAST, depending on platform, inside the eu.a runtime library.
5. Comment by SPringle
Aug 12, 2010
Ofcourse that would move constants from only EUPHORIA to C and EUPHORIA. Right now, we need a set of constants for each platform. What you are suggesting would result in several include statements in C and only two matching constant lists: one for C in the backend and one for EUPHORIA in std/socket.e.
6. Comment by mattlewis
Sep 27, 2010
The demo works for me under linux and svn:3425, so I guess it's just a matter of deciding on how to handle the constants cross platform (or not).
7. Comment by mattlewis
Oct 22, 2010
Closing. This appears to be fixed, and no one appears interested in changing the cross platform nature of the constants.