initializing socket sub