'A factory method which allows subclasses to define the precise
type of socket they want.'

def makeSocket(self, timeout=1):

    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    if hasattr(s, 'settimeout'):
        s.settimeout(timeout)
    s.connect((self.host, self.port))
    return s
