| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Deadlocks in datagram sockets are the most common mistakes that novices
make. To alleviate the problem, sockbuf class provides timeout
facilities that can be used effectively to avoid deadlocks.
Consider the following simple tsmtp example which sends the HELP command to a
smtp server and gets back the help message. Suppose it does not know
the size of the help message nor the format of the message. In such
cases, the timeout facilities of sockbuf class provides the
required tools.
The example terminates the help message reception if the there is no input activity from the smtp server for 10 seconds.
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |