Exemplo n.º 1
0
        internal void CancelRequest( Request req )
        {
            m_requests.Remove( req );

            req.Signal( );
        }
Exemplo n.º 2
0
        private IncomingMessage[ ] SyncMessages( OutgoingMessage[ ] messages, int retries, int timeout )
        {
            int cMessage = messages.Length;
            IncomingMessage[ ] replies = new IncomingMessage[ cMessage ];
            Request[ ] requests = new Request[ cMessage ];

            for( int iMessage = 0; iMessage < cMessage; iMessage++ )
            {
                replies[ iMessage ] = SyncRequest( messages[ iMessage ], retries, timeout );
            }

            return replies;
        }
Exemplo n.º 3
0
        internal Request AsyncRequest( OutgoingMessage msg, int retries, int timeout )
        {
            Request req = new Request( this, msg, retries, timeout, null );

            lock( m_state.SyncObject )
            {

                //Checking whether IsRunning and adding the request to m_requests
                //needs to be atomic to avoid adding a request after the Engine
                //has been stopped.

                if( !IsRunning )
                {
                    throw new ApplicationException( "Engine is not running or process has exited." );
                }

                m_requests.Add( req );

                req.SendAsync( );
            }

            return req;
        }