forwardConnecting to Backup Sessions   Table of ContentLicensingforward
Connecting to Multiple Segments

Handler instance allows to connect to single segment only. To connect to multiple segments, there is need to create one handler instance for each segment. Please see miltisegment sample from installation package.

Note Note

Segment id is specified as session TargetSubID. SenderCompId and SenderSubId will be same for all segments.

Example

Following example demonstrates how to connect to multiple segments:

C#
Handler handler1 = new Handler("SenderCompId", "SenderSubId", "Segment1");
handler1.ExecutionReportReceived += new EventHandler<MessageEventArgs>(handler_ExecutionReportReceived);
handler1.MassOrderCancelReportReceived += new EventHandler<MessageEventArgs>(handler_MassOrderCancelReportReceived);

// Same SenderCompId and SenderSubId, but different TargetSubID
Handler handler2 = new Handler("SenderCompId", "SenderSubId", "Segment2");
handler2.ExecutionReportReceived += new EventHandler<MessageEventArgs>(handler_ExecutionReportReceived);
handler2.MassOrderCancelReportReceived += new EventHandler<MessageEventArgs>(handler_MassOrderCancelReportReceived);

handler1.Logon(host1, port1, "password");
handler2.Logon(host2, port2, "password");