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

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

            request.Type = RemotingRequestType.Oneway;
            _clientSocket.QueueMessage(RemotingUtil.BuildRequestMessage(request));
        }
コード例 #3
0
        public Task <RemotingResponse> InvokeAsync(RemotingRequest request, int timeoutMillis)
        {
            EnsureClientStatus();
            request.Type = RemotingRequestType.Async;
            var taskCompletionSource = new TaskCompletionSource <RemotingResponse>();
            var responseFuture       = new ResponseFuture(request, timeoutMillis, taskCompletionSource);

            if (!_responseFutureDict.TryAdd(request.Sequence, responseFuture))
            {
                throw new ResponseFutureAddFailedException(request.Sequence);
            }
            _clientSocket.QueueMessage(RemotingUtil.BuildRequestMessage(request));
            return(taskCompletionSource.Task);
        }