improved socket module for network module