Commit Graph

5 Commits

Author SHA1 Message Date
Peter S. May 79ee8c1c81 Block+timeout CanRead/CanWrite/DataAvailable EzSockets methods.
A minor change to the code exposes the timeout parameter of `select()`, which was already in use for CanRead()/CanWrite(). The timeout parameter is used to block the current thread until data (for read) or space (for write) is available on the underlying socket.

A timeout of 0 suppresses any blocking (the original methods fix the timeout to 0).

The timeout value is supplied in milliseconds as an `unsigned int`; this is converted internally to the equivalent `timeval`.

An in-progress addition to my SextetStream input driver is implemented with non-blocking reads on a TCP socket. Without the block+timeout functionality, it must busy-wait for new input. Changing the reads to blocking works during a game but can cause the program to hang when exiting. The changes in this commit provide a solution to both issues without disrupting any existing code.
2015-04-23 12:50:28 -04:00
AJ Kelly cf81f8cc3b remove xbox support; it doesn't work, and it'd take too much effort to get it working again 2011-03-19 19:28:57 -05:00
Jason Felds a085d0d1da Line endings...be normalized! 2011-03-17 01:47:30 -04:00
AJ Kelly 3e51544930 Initial commit. 2010-01-26 21:00:30 -06:00
Devin J. Pohly 80057f53cd smsvn -> ssc-hg glue: rearrange directory structure 2013-06-10 15:38:43 -04:00