def METHOD_NAME(self, host):
    """Create tcp socket, connect to it and return socket object."""
    port = int(self['TCPSocket'])
    sockinfo = get_sockinfo(host, port=port)
    sock = create_socket(socket.AF_INET, socket.SOCK_STREAM)
    try:
        sock.connect(sockinfo[0][4])
    except OSError:
        sock.close()
        raise
    return sock