image/svg+xml
  • OnixS .NET CME iLink3 Handler
  • Programming Guide
  • Api Documentation
  • Version 1.7.1
    • Programming Guide
    • Advanced Programming
    • Scheduling Sessions for Automatic Connection
Show / Hide Table of Contents
  • Introduction
  • System Requirements
  • Getting Started
    • Error Reporting
    • Licensing
    • SBE Message
      • Tag-based Messaging
      • Message Fields
      • Repeating Groups
    • iLink 3 Session
      • Universally Unique Identifier
      • Establishing iLink3 Connection
      • Exchanging Messages
      • Message Sequence Numbers
  • Configuring the Handler
    • Configuration File Examples (XML or JSON)
  • Logging
  • Session Storage
    • File-Based Session Storage
    • Memory-based Session Storage
    • Asynchronous File-Based Session Storage
    • Pluggable Session Storage
  • Advanced Programming
    • Thread Safety
    • Session Initialization and Binding
    • Session States
    • Listening to Session Events
    • Handling NotApplied Messages
    • Handling Business Reject Messages
    • Automated Downloading of GTC and GTD Orders
    • Reconnection
    • Fault Tolerance
    • Understanding Send Latency
    • Strongly Typed Messages
    • Scheduling Sessions for Automatic Connection
    • Predefined Schedules and Connection Settings
    • Session Connection Settings
    • Session Schedule
  • Audit Trail Generator
  • Best Practices
    • Low Latency Best Practices
  • Glossary
  • Samples
  • Support

Scheduling Sessions for Automatic Connection

Sessions Scheduler

The Sessions Scheduler service cat automatically connect sessions to the counterparty at the beginning of the trading week/day, keep a session connected for the entire trading week/day, and disconnect it at the end of the last trading week/day.

SessionScheduler class

The SessionScheduler is the main class of the Sessions Scheduling services.

Registering a Session for Automatic Connection

The Add method schedules a session for automatic logon and logout according to the specified session time, that can be given to the Scheduler as an instance of the SessionSchedule class, or as an id of the predefined schedule.

The SessionConnectionSettings argument specifies the connection settings.

If the session is being registered between the scheduled logon and logout time, the Scheduler will connect the session immediately.

Removing Session from Scheduler

The Remove(Session) method removes the given session from the scheduling services.

Remove(Session) does not disconnect an active session. Therefore, if the session has already been connected by the Scheduler, it remains connected after unregistering.

Handling Scheduling Warnings and Errors

The Scheduler exposes events to notify about errors in the session schedule.

The Scheduler calls the SessionSchedulerWarning event to notify about non-critical issues.

Scheduling Rules

  • If the session is registered between the scheduled logon and logout time, the Scheduler will connect the session immediately.
  • If the session is registered after the logout and before the logon time, the Scheduler will make no attempts to connect the session until the next logon time.
  • If the session is registered after the logout and before the logon time, and the session is in an active state, it will be disconnected immediately.
  • In case of a logon failure, the Scheduler tries to logon again per its reconnection settings (ReconnectAttempts and ReconnectInterval).
  • In the Handler detects a network error, it tries to restore the connection per the Session configuration (ReconnectAttempts and ReconnectInterval).
  • In the exchange disconnect the session during the active windows, the Scheduler tries to connect the session again immediately without delay.
  • If the Scheduler connects the session within reconnection attempts defined by the Session configuration, it does not report an error.
  • If the session is still in the Reconnecting state and the logout time is reached, the Scheduler will stop the reconnect attempts, and will not report an error.
  • If the session remains disconnected after all reconnect attempts, the SessionSchedulerError event will be called.
  • Once the Scheduler calls the SessionSchedulerError event, it stops all attempts to connect the session until the next logon time.
var session = new Session(new SessionSettings(), 14, SessionStorageType.MemoryBasedStorage);
var scheduler = new SessionScheduler();

var connectivity = new SessionConnectionSettings("127.0.0.1", 1000);
var schedule = new SessionSchedule(DayOfWeek.Monday, DayOfWeek.Friday, new TimeSpan(9, 0, 0), new TimeSpan(18, 0, 0));

scheduler.Add(session, schedule, connectivity);

See Also

  • The Session Scheduler sample from the distribution package.
In this article
  • Sessions Scheduler
  • SessionScheduler class
  • Registering a Session for Automatic Connection
  • Removing Session from Scheduler
  • Handling Scheduling Warnings and Errors
  • Scheduling Rules
  • See Also
Back to top Copyright © Onix Solutions.
Generated by DocFX