implemented listen function to accept connections to a ServerSocket