Networking Subsystem

The Networking subsystem is a wrapper around OS-specific networking (namely, Windows Sockets and BSD Sockets). The purpose is to completely hide the OS-specific from users of these classes.

Usage: Read the public interfaces of SocketClient and SocketServer. Really, thats all there's to it. Some things you should keep in mind tho:

Almost all public member functions of SocketServer/SocketClient classes may throw exceptions if things go wrong. Practice has shown that using return values to indicate errors doesn't get us anywhere, since everyone will simply ignore the return values. So there - now you can't ignore the errors anymore. So basically, get to writing try/catch blocks at all accesses to sockets. I know its tedious, but its safer than to have sockets around in odd/broken states and still "available" for usage.

Internal stuff: Sockets register themselves with SocketWatcher, which performs sockets polling for events. When events are detected, the events are posted to event subsystem. Refer to SocketWatcher documentation and implementation for more information.