Article # 164, added by Geoworks, historical record
| first | previous | index | next | last |

How to make SocketRecv() event-driven.



Q. Can the API SocketRecv() be made event-driven? That is, can I
   "register" a callback function and have it called back whenever
   the status of SocketRecv() changes? 

A. There is no direct way to receive data in an event driven manner,
   so you will need to set up a thread to scan for data. Spawn a
   separate thread to have a loop that calls (and blocks on)
   SocketCheckReady, and sends out appropriate messages or call the
   callback routines when something changes.