Exemple #1
0
        public Task <ResultSet <T> > SubmitAsync <T>(RequestMessage requestMessage)
        {
            var receiver = new ResponseHandlerForSingleRequestMessage <T>(_graphSONReader);

            _callbackByRequestId.GetOrAdd(requestMessage.RequestId, receiver);
            _writeQueue.Enqueue(requestMessage);
            BeginSendingMessages();
            return(receiver.Result);
        }
Exemple #2
0
        /// <summary>
        ///     Gets the number of open connections.
        /// </summary>
        public Task <ResultSet <T> > SubmitAsync <T>(RequestMessage requestMessage)
        {
            var receiver = new ResponseHandlerForSingleRequestMessage <T>(_graphSONReader);

            _callbackByRequestId.GetOrAdd(requestMessage.RequestId, receiver);
            _writeQueue.Enqueue(requestMessage);
            //if (! IsOpen)
            //{
            //    Debug.WriteLine("web soket!");
            //    NotifyAboutConnectionFailure(new WebSocketException("Connection not open at time of submit"));
            //}
            BeginSendingMessages();
            return(receiver.Result);
        }