Added basic monitoring support for sockets. Fixes #4