Exemplo n.º 1
0
    def __init__(self):
        FIXEngine.__init__(self)
        self.clOrdID = 0
        self.msgGenerator = None

        # create a FIX Client using the FIX 4.4 standard
        self.client = FIXClient(self, "pyfix.FIX44", 'OKSERVER',
                                str(uuid.uuid1()))

        # we register some listeners since we want to know when the connection goes up or down
        self.client.addConnectionListener(self.onConnect,
                                          ConnectionState.CONNECTED)
        self.client.addConnectionListener(self.onDisconnect,
                                          ConnectionState.DISCONNECTED)

        # start our event listener indefinitely
        self.client.start(HOST, int(PORT))
        while True:
            self.eventManager.waitForEventWithTimeout(10.0)

        # some clean up before we shut down
        self.client.removeConnectionListener(self.onConnect,
                                             ConnectionState.CONNECTED)
        self.client.removeConnectionListener(self.onConnect,
                                             ConnectionState.DISCONNECTED)
Exemplo n.º 2
0
    def __init__(self):
        FIXEngine.__init__(self, "server_example.store")
        # create a FIX Server using the FIX 4.4 standard
        self.server = FIXServer(self, "pyfix.FIX44")

        # we register some listeners since we want to know when the connection goes up or down
        self.server.addConnectionListener(self.onConnect, ConnectionState.CONNECTED)
        self.server.addConnectionListener(self.onDisconnect, ConnectionState.DISCONNECTED)

        # start our event listener indefinitely
        self.server.start('', int("9898"))
        while True:
            self.eventManager.waitForEventWithTimeout(10.0)

        # some clean up before we shut down
        self.server.removeConnectionListener(self.onConnect, ConnectionState.CONNECTED)
        self.server.removeConnectionListener(self.onConnect, ConnectionState.DISCONNECTED)
Exemplo n.º 3
0
    def __init__(self):
        FIXEngine.__init__(self, "server_example.store")
        # create a FIX Server using the FIX 4.4 standard
        self.server = FIXServer(self, "pyfix.FIX44")

        # we register some listeners since we want to know when the connection goes up or down
        self.server.addConnectionListener(self.onConnect, ConnectionState.CONNECTED)
        self.server.addConnectionListener(self.onDisconnect, ConnectionState.DISCONNECTED)

        # start our event listener indefinitely
        self.server.start('', int("9898"))
        while True:
            self.eventManager.waitForEventWithTimeout(10.0)

        # some clean up before we shut down
        self.server.removeConnectionListener(self.onConnect, ConnectionState.CONNECTED)
        self.server.removeConnectionListener(self.onConnect, ConnectionState.DISCONNECTED)
Exemplo n.º 4
0
    def __init__(self):
        FIXEngine.__init__(self, "client_example.store")
        self.clOrdID = 0
        self.msgGenerator = None

        # create a FIX Client using the FIX 4.4 standard
        self.client = FIXClient(self, "pyfix.FIX44", "TARGET", "SENDER")

        # we register some listeners since we want to know when the connection goes up or down
        self.client.addConnectionListener(self.onConnect, ConnectionState.CONNECTED)
        self.client.addConnectionListener(self.onDisconnect, ConnectionState.DISCONNECTED)

        # start our event listener indefinitely
        self.client.start('localhost', int("9898"))
        while True:
            self.eventManager.waitForEventWithTimeout(10.0)

        # some clean up before we shut down
        self.client.removeConnectionListener(self.onConnect, ConnectionState.CONNECTED)
        self.client.removeConnectionListener(self.onConnect, ConnectionState.DISCONNECTED)