'Creates a TWS client socket and connects it.
@param host name of host for connection; default is localhost
@param port port number for connection; default is 7496
@param clientId client identifier to send when connected
@param handler object to receive reader messages
@keyparam clientType=EClientSocket callable producing socket client
@return True if connected, False otherwise'

def connect(self, host, port, clientId, handler, clientType=EClientSocket):

    def reconnect():
        self.client = client = clientType(handler)
        client.eConnect(host, port, clientId)
        return client.isConnected()
    self.reconnect = reconnect
    return self.reconnect()
