Improving network API

Adding state checking methods for knowing if the
server/client is started, connected, shutdown, etc.

Also improved some exception handling to better
know when the socket is disconnected or closed
and not print the exception stack trace when that
occurs.

Already updated Unit tests.