* Moved WSA open/close to functions so that I don't need to use #ifdef _WIN32 everywhere.

* Added comments where needed.