initializing sockets code