Added createSocket() method for testing purposes.