Depending upon the structure of your code you could use threads and block on the socket - then when data is recieved use one of the sychronisation tools (queues, semaphores etc) to "wake up" or tigger an event in another thread.
- TCP/IP driven event / Interrupt Toni
- WPS