Ejemplo n.º 1
0
 public Level2Snapshot(
     SocketClient socketClient,
     Level2RequestFormatter level2RequestFormatter,
     ILevel2MessageHandler <T> level2MessageHandler,
     TimeSpan timeout)
 {
     _socketClient           = socketClient;
     _level2RequestFormatter = level2RequestFormatter;
     _level2MessageHandler   = level2MessageHandler;
     _timeout = timeout;
 }
        public static Level2Client <T> CreateNew <T>(
            string host,
            int port,
            TimeSpan snapshotTimeout,
            ILevel2MessageHandler <T> level2MessageHandler)
        {
            var socketClient           = new SocketClient(host, port);
            var level2RequestFormatter = new Level2RequestFormatter();

            return(new Level2Client <T>(
                       socketClient,
                       level2RequestFormatter,
                       level2MessageHandler,
                       new Level2Snapshot <T>(socketClient, level2RequestFormatter, level2MessageHandler, snapshotTimeout)
                       ));
        }