Improved SocketClient and SocketServer main

Improved SocketClient and SocketServer main