コード例 #1
0
        public void InvokeOneway(RemotingRequest request)
        {
            EnsureClientStatus();

            request.Type = RemotingRequestType.Oneway;
            _clientSocket.QueueMessage(RemotingUtil.BuildRequestMessage(request));
        }
コード例 #2
0
        public void InvokeWithCallback(RemotingRequest request)
        {
            EnsureClientStatus();

            request.Type = RemotingRequestType.Callback;
            _clientSocket.QueueMessage(RemotingUtil.BuildRequestMessage(request));
        }
コード例 #3
0
        public void InvokeOneway(RemotingRequest request)
        {
            EnsureClientStatus();

            request.IsOneway = true;
            _tcpClient.SendAsync(RemotingUtil.BuildRequestMessage(request));
        }
コード例 #4
0
        public void InvokeOneway(RemotingRequest request, int timeoutMillis)
        {
            EnsureClientStatus();

            request.IsOneway = true;
            _tcpClient.SendMessage(RemotingUtil.BuildRequestMessage(request));
        }
コード例 #5
0
        public Task <RemotingResponse> InvokeAsync(RemotingRequest request, int timeoutMillis = 5000)
        {
            EnsureClientStatus();

            var taskCompletionSource = new TaskCompletionSource <RemotingResponse>();
            var responseFuture       = new ResponseFuture(request, timeoutMillis, taskCompletionSource);

            if (!_responseFutureDict.TryAdd(request.Sequence, responseFuture))
            {
                throw new ResponseFutureAddFailedException(request.Sequence);
            }

            _tcpClient.SendAsync(RemotingUtil.BuildRequestMessage(request));

            return(taskCompletionSource.Task);
        }