//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public Object get() throws exception.RemotingException, ThreadInterruptedException
        public virtual object get()
        {
            ResponseCommand responseCommand = (ResponseCommand)future.waitResponse();

            responseCommand.InvokeContext = future.InvokeContext;
            return(RpcResponseResolver.resolveResponseObject(responseCommand, addr));
        }
        /// <summary>
        /// get result with timeout specified
        ///
        /// if request done, resolve normal responseObject
        /// if request not done, throws InvokeTimeoutException
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public Object get(int timeoutMillis) throws rpc.exception.InvokeTimeoutException, exception.RemotingException, ThreadInterruptedException
        public virtual object get(int timeoutMillis)
        {
            future.waitResponse(timeoutMillis);
            if (!Done)
            {
                throw new InvokeTimeoutException("Future get result timeout!");
            }
            ResponseCommand responseCommand = (ResponseCommand)future.waitResponse();

            responseCommand.InvokeContext = future.InvokeContext;
            return(RpcResponseResolver.resolveResponseObject(responseCommand, addr));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Synchronous rpc invocation.<br>
        /// Notice! DO NOT modify the request object concurrently when this method is called.
        /// </summary>
        /// <param name="conn"> </param>
        /// <param name="request"> </param>
        /// <param name="invokeContext"> </param>
        /// <param name="timeoutMillis">
        /// @return </param>
        /// <exception cref="RemotingException"> </exception>
        /// <exception cref="ThreadInterruptedException"> </exception>
        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: public Object invokeSync(final Connection conn, final Object request, final InvokeContext invokeContext, final int timeoutMillis) throws exception.RemotingException, ThreadInterruptedException
        //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
        public virtual object invokeSync(Connection conn, object request, InvokeContext invokeContext, int timeoutMillis)
        {
            RemotingCommand requestCommand = toRemotingCommand(request, conn, invokeContext, timeoutMillis);

            preProcessInvokeContext(invokeContext, requestCommand, conn);
            ResponseCommand responseCommand = (ResponseCommand)base.invokeSync(conn, requestCommand, timeoutMillis);

            responseCommand.InvokeContext = invokeContext;

            object responseObject = RpcResponseResolver.resolveResponseObject(responseCommand, ((IPEndPoint)conn.Channel?.RemoteAddress)?.ToString());

            return(responseObject);
        }