adding simple socket server
added error checks on listen and accept