Secure Socket Multiplexing
If your application tries to read from a secure socket whose buffers are empty, or tries to write to a secure socket whose buffers are full, the secure socket usually blocks or pauses the application until it can complete the operation. This is a problem if your application uses more than one socket at a time.
For example, an application could create two secure sockets, s1 and s2, that display any data that arrives on a secure socket. Initially, data is not available on either socket. If the application reads from s1, execution blocks until data is available on that secure socket. In the meantime, data could arrive on s2, but the program would never receive it because the program is waiting for s1.
The solution is to block on both secure sockets simultaneously. The following sections explain how.