Basic socket implementation.