Use abstract SocketListener class

Makes the code more general and not directly tied to specifically
TCP sockets.
11 files changed