Network problems When a program works with a network connection, problems are the rule, rather then the exception. Users might supply invalid network addresses. Servers may be down. Network connections might be broken unexpectedly, or just stop responding. Creating a connection is usually a blocking operation - perform it in a separate thread/process then the one handling the user interface. Never perform a read or write operation on a socket without first checking there's data waiting (or free buffers) using select() or poll(). The exception is when dedicating a thread or process to the network I/O operation.