Exemplo n.º 1
0
            public UserDataStream(UserDataCache owner)
            {
                try
                {
                    Cache    = owner;
                    Balances = Api.GetBalances().Result;
                    Orders   = new OrdersStream(Api);
                    History  = new HistoryStream(Api);
                    UserDataKeepAliveTimeout = TimeSpan.FromMinutes(30);

                    // Start the user data stream. User data times out after 60minutes
                    ListenKey         = Api.StartUserDataStream().Result;
                    m_listen_key_bump = DateTimeOffset.Now;

                    // Create the socket (requires the ListenKey in the endpoint URL)
                    Socket = new WebSocket(Api.Shutdown);
                }
                catch
                {
                    Dispose();
                    throw;
                }
            }
 void GivenAHistoryStreamWithBufferSize(int size)
 {
     HistoryStream = new HistoryStream(Stream, size);
 }
 void GivenAHistoryStream()
 {
     HistoryStream = new HistoryStream(Stream);
 }