The Lab

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »



A session may be logged off in one of two ways: synchronously at the request of the client, or asynchronously by the server, either as a result of the client being a slow consumer of data, or being disconnected by MarketFactory support personnel.
@Override
public void on(com.marketfactory.mfclient.api.core.trading.Logout logout, MFMarketDataSession session) {
System.out.println("Processing logoff request on trading session " +
session.getVenueName() + ", reason: " + logout.getText());
try {
session.logoutResponse(); // acknowledge logout request
} catch (final MFException mfe) { mfe.printStackTrace(); System.exit(-1);
}
}
Listing 2.3 – processing logoff request from server




  • No labels