matlo/GIMX — pull request #298 by sdelgran (2014-12-04 05:22:20+00:00)
Title: Possible timeout code

Could not get UDP client timeout to work using setsockopt(). Not sure why...
Using select works nicely and work just as-is on both platform (while SO_RCVTIMEO will need adjusting).

Please refactor to your standards or scrap it. This is just a way to communicate what I did to make it work on my side.
Reference: http://stackoverflow.com/questions/1824465/set-timeout-for-winsock-recvfrom

If using setsockopt() with SO_RCVTIMEO:
- WINDOWS: Timeout value is a DWORD in milliseconds, address passed to setsockopt() is const char *
- LINUX: Timeout value is a struct timeval, address passed to setsockopt() is const void *

Tested on Ubuntu 14.04 TLS 32 bits and Windows 8.1 64 bits:
- Sent command to listening remote Gimx: Received.
- Sent command to inexistent remote Gimx: Timeout message after 2 seconds.