XSockets implementation