Exemplo n.º 1
0
 protected void Initalize(string connectionKey, GiopTransportMessageHandler transportHandler,
                          GiopClientConnectionDesc assocDesc)
 {
     m_connectionKey    = connectionKey;
     m_assocDesc        = assocDesc;
     m_transportHandler = transportHandler;
 }
Exemplo n.º 2
0
 internal GiopClientConnectionDesc(GiopClientConnectionManager conManager, GiopClientConnection connection,
                                   GiopRequestNumberGenerator reqNumberGen,
                                   GiopTransportMessageHandler transportHandler)
     : base(conManager, transportHandler)
 {
     m_reqNumGen  = reqNumberGen;
     m_connection = connection;
 }
Exemplo n.º 3
0
 internal AsynchronousResponseWaiter(GiopTransportMessageHandler transportHandler,
                                     uint requestId,
                                     AsyncResponseAvailableCallBack callback,
                                     IClientChannelSinkStack clientSinkStack,
                                     GiopClientConnection connection,
                                     MessageTimeout timeOut)
 {
     Initalize(transportHandler, requestId, callback, clientSinkStack, connection, timeOut);
 }
Exemplo n.º 4
0
        /// <param name="connectionKey">the key describing the connection</param>
        internal GiopBidirInitiatedConnection(string connectionKey, GiopTransportMessageHandler transportHandler,
                                              GiopClientConnectionManager conManager)
        {
            GiopRequestNumberGenerator reqNumberGen =
                new GiopRequestNumberGenerator(false);     // not connection originator -> create non-even req. numbers
            GiopClientConnectionDesc conDesc = new GiopClientConnectionDesc(conManager, this, reqNumberGen,
                                                                            transportHandler);

            Initalize(connectionKey, transportHandler, conDesc);
        }
Exemplo n.º 5
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state,
                                         IMessage msg, ITransportHeaders headers, Stream stream)
        {
#if DEBUG
            Debug.WriteLine("Send response async");
            OutputHelper.LogStream(stream);
#endif
            GiopTransportMessageHandler giopTransportMsgHandler =
                ((GiopServerConnection)state).TransportHandler;
            giopTransportMsgHandler.SendResponse(stream); // send the response
        }
Exemplo n.º 6
0
        /// <param name="connectionKey">the key describing the connection</param>
        /// <param name="transport">a not yet connected client transport</param>
        /// <param name="headerFlags">the header flags to use for transport related giop messages.</param>
        internal GiopClientInitiatedConnection(string connectionKey, IClientTransport transport,
                                               MessageTimeout requestTimeOut, GiopClientConnectionManager conManager,
                                               bool supportBidir, byte headerFlags)
        {
            GiopRequestNumberGenerator reqNumberGen =
                (!supportBidir ? new GiopRequestNumberGenerator() : new GiopRequestNumberGenerator(true));
            GiopTransportMessageHandler handler =
                new GiopTransportMessageHandler(transport, requestTimeOut, headerFlags);
            GiopClientConnectionDesc conDesc = new GiopClientConnectionDesc(conManager, this, reqNumberGen, handler);

            m_clientTransport = transport;
            Initalize(connectionKey, handler, conDesc);
        }
Exemplo n.º 7
0
 private void Initalize(GiopTransportMessageHandler transportHandler,
                        uint requestId,
                        AsyncResponseAvailableCallBack callback,
                        IClientChannelSinkStack clientSinkStack,
                        GiopClientConnection connection,
                        MessageTimeout timeOutMillis)
 {
     m_alreadyNotified  = false;
     m_transportHandler = transportHandler;
     m_requestId        = requestId;
     m_callback         = callback;
     m_clientConnection = connection;
     m_clientSinkStack  = clientSinkStack;
     m_timeOut          = timeOutMillis;
 }
Exemplo n.º 8
0
 /// <summary>creates a giop transport message handler, which accept request messages by delegating to receiver</summary>
 /// <param name="serverThreadsMaxPerConnection">
 /// the maximum number of server threads used for processing requests on a multiplexed client connection.
 /// </param>
 internal GiopReceivedRequestMessageDispatcher(IGiopRequestMessageReceiver receiver, GiopTransportMessageHandler msgHandler,
                                               GiopConnectionDesc conDesc, int serverThreadsMaxPerConnection)
 {
     m_serverCon = new GiopServerConnection(conDesc, this);
     if (receiver != null)
     {
         m_receiver = receiver;
     }
     else
     {
         throw new BAD_PARAM(400, CompletionStatus.Completed_MayBe);
     }
     m_msgHandler = msgHandler;
     if (serverThreadsMaxPerConnection < 1)
     {
         throw new BAD_PARAM(401, CompletionStatus.Completed_MayBe);
     }
     m_maxRequestsAllowedInParallel = serverThreadsMaxPerConnection;
 }
Exemplo n.º 9
0
 public void ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream,
                            out ITransportHeaders responseHeaders, out Stream responseStream)
 {
     #if DEBUG
     OutputHelper.LogStream(requestStream);
     #endif
     // called by the chain, chain expect response-stream and headers back
     GiopClientConnection        clientCon = GetClientConnection(msg);
     GiopTransportMessageHandler handler   = clientCon.TransportHandler;
     // send request and wait for response
     responseHeaders = new TransportHeaders();
     responseHeaders[GiopClientConnectionDesc.CLIENT_TR_HEADER_KEY] = clientCon.Desc; // add to response headers
     uint reqNr = (uint)msg.Properties[SimpleGiopMsg.REQUEST_ID_KEY];
     responseStream = handler.SendRequestSynchronous(requestStream, reqNr, clientCon);
     #if DEBUG
     OutputHelper.LogStream(responseStream);
     #endif
     responseStream.Seek(0, SeekOrigin.Begin); // assure stream is read from beginning in formatter
     // the previous sink in the chain does further process this response ...
 }
Exemplo n.º 10
0
 /// <summary>configures a client initiated connection to receive callbacks.</summary>
 /// <remarks>for use case (2)</remarks>
 internal void SetupConnectionForBidirReception(GiopClientConnectionDesc conDesc)
 {
     if (m_receptionHandler != null)
     {
         if (conDesc.Connection is GiopClientInitiatedConnection)
         {
             GiopTransportMessageHandler handler =
                 conDesc.Connection.TransportHandler;
             handler.InstallReceiver(m_receptionHandler, conDesc,
                                     m_serverThreadsMaxPerConnection); // set, if not yet set.
         }
         else
         {
             throw new INTERNAL(545, CompletionStatus.Completed_MayBe);
         }
     }
     else
     {
         throw new INTERNAL(544, CompletionStatus.Completed_MayBe);
     }
 }
Exemplo n.º 11
0
 public void AsyncProcessRequest(IClientChannelSinkStack sinkStack, IMessage msg,
                                 ITransportHeaders headers, Stream requestStream)
 {
     #if DEBUG
     OutputHelper.LogStream(requestStream);
     #endif
     // this is the last sink in the chain, therefore the call is not forwarded, instead the request is sent
     GiopClientConnection        clientCon = GetClientConnection(msg);
     GiopTransportMessageHandler handler   = clientCon.TransportHandler;
     uint reqNr = (uint)msg.Properties[SimpleGiopMsg.REQUEST_ID_KEY];
     if (!GiopMessageHandler.IsOneWayCall((IMethodCallMessage)msg))
     {
         handler.SendRequestMessageAsync(requestStream, reqNr,
                                         new AsyncResponseAvailableCallBack(this.AsyncResponseArrived),
                                         sinkStack, clientCon);
     }
     else
     {
         handler.SendRequestMessageOneWay(requestStream, reqNr, clientCon);
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// this method handles the incoming messages from one client; 
 /// it's called by the IServerListener
 /// </summary>
 private void ProcessClientMessages(IServerTransport transport)
 {
     GiopTransportMessageHandler handler =
         new GiopTransportMessageHandler(transport, m_headerFlags);
     GiopConnectionDesc conDesc = new GiopConnectionDesc(m_bidirConnectionManager, handler);
     handler.InstallReceiver(m_transportSink, conDesc, m_serverThreadsMaxPerConnection);
     handler.ConnectionClosed +=
         new GiopTransportMessageHandler.ConnectionClosedDelegate(EndClientMessages);
     lock (m_activeClients.SyncRoot)
     {
         m_activeClients.Add(handler);
         Debug.WriteLine("added client; peer addr: " + handler.Transport.GetPeerAddress());
         Debug.WriteLine("added client; new number of active: " + m_activeClients.Count);
     }
     handler.StartMessageReception();
 }
Exemplo n.º 13
0
 /// <summary>
 /// informs the channel, that the message handling for a specific client has ended.
 /// </summary>
 private void EndClientMessages(GiopTransportMessageHandler sender, EventArgs args)
 {
     // the client is represented by the GiopTransportMessageHandler
     lock (m_activeClients.SyncRoot)
     {
         m_activeClients.Remove(sender); // remove from active clients.
         Debug.WriteLine("removed client; new number of active: " + m_activeClients.Count);
     }
 }
Exemplo n.º 14
0
 public SynchronousResponseWaiter(GiopTransportMessageHandler handler)
 {
     m_waiter  = new ManualResetEvent(false);
     m_handler = handler;
 }
Exemplo n.º 15
0
 public MessageSendTask(ITransport onTransport,
                        GiopTransportMessageHandler messageHandler) {
     Initalize(onTransport, messageHandler);
 }
Exemplo n.º 16
0
 /// <param name="connectionKey">the key describing the connection</param>
 /// <param name="transport">a not yet connected client transport</param>
 /// <param name="headerFlags">the header flags to use for transport related giop messages.</param>
 internal GiopClientInitiatedConnection(string connectionKey, IClientTransport transport,
                                        MessageTimeout requestTimeOut, GiopClientConnectionManager conManager,
                                        bool supportBidir, byte headerFlags)
 {
     GiopRequestNumberGenerator reqNumberGen =
         (!supportBidir ? new GiopRequestNumberGenerator() : new GiopRequestNumberGenerator(true));
     GiopTransportMessageHandler handler =
               new GiopTransportMessageHandler(transport, requestTimeOut, headerFlags);
     GiopClientConnectionDesc conDesc = new GiopClientConnectionDesc(conManager, this, reqNumberGen, handler);
     m_clientTransport = transport;
     Initalize(connectionKey, handler, conDesc);
 }
Exemplo n.º 17
0
 public MessageSendTask(ITransport onTransport,
                        GiopTransportMessageHandler messageHandler)
 {
     Initalize(onTransport, messageHandler);
 }
Exemplo n.º 18
0
 protected void Initalize(string connectionKey, GiopTransportMessageHandler transportHandler,
                          GiopClientConnectionDesc assocDesc)
 {
     m_connectionKey = connectionKey;
     m_assocDesc = assocDesc;
     m_transportHandler = transportHandler;
 }
Exemplo n.º 19
0
 internal AsynchronousResponseWaiter(GiopTransportMessageHandler transportHandler,
                                     uint requestId,
                                     AsyncResponseAvailableCallBack callback,
                                     IClientChannelSinkStack clientSinkStack,
                                     GiopClientConnection connection,
                                     MessageTimeout timeOut) {
     Initalize(transportHandler, requestId, callback, clientSinkStack, connection, timeOut);
 }
Exemplo n.º 20
0
 public SynchronousResponseWaiter(GiopTransportMessageHandler handler) {
     m_waiter = new ManualResetEvent(false);
     m_handler = handler;
 }
Exemplo n.º 21
0
 public MessageReceiveTask(ITransport onTransport,
                           GiopTransportMessageHandler messageHandler) {
     m_onTransport = onTransport;
     m_messageHandler = messageHandler;
 }
Exemplo n.º 22
0
 private void Initalize(ITransport onTransport,
                        GiopTransportMessageHandler messageHandler) {
     m_onTransport = onTransport;
     m_messageHandler = messageHandler;
 }
Exemplo n.º 23
0
 internal GiopConnectionDesc(GiopClientConnectionManager conManager,
                            GiopTransportMessageHandler transportHandler)
 {
     m_conManager = conManager;
     m_transportHandler = transportHandler;
 }
Exemplo n.º 24
0
 private void Initalize(ITransport onTransport,
                        GiopTransportMessageHandler messageHandler)
 {
     m_onTransport    = onTransport;
     m_messageHandler = messageHandler;
 }
Exemplo n.º 25
0
 /// <param name="connectionKey">the key describing the connection</param>        
 internal GiopBidirInitiatedConnection(string connectionKey, GiopTransportMessageHandler transportHandler,
                                       GiopClientConnectionManager conManager)
 {
     GiopRequestNumberGenerator reqNumberGen =
             new GiopRequestNumberGenerator(false); // not connection originator -> create non-even req. numbers
     GiopClientConnectionDesc conDesc = new GiopClientConnectionDesc(conManager, this, reqNumberGen,
                                                                     transportHandler);
     Initalize(connectionKey, transportHandler, conDesc);
 }
Exemplo n.º 26
0
 public MessageReceiveTask(ITransport onTransport,
                           GiopTransportMessageHandler messageHandler)
 {
     m_onTransport    = onTransport;
     m_messageHandler = messageHandler;
 }
Exemplo n.º 27
0
 private void Initalize(GiopTransportMessageHandler transportHandler,
                        uint requestId,
                        AsyncResponseAvailableCallBack callback,
                        IClientChannelSinkStack clientSinkStack,
                        GiopClientConnection connection,
                        MessageTimeout timeOutMillis) {
     m_alreadyNotified = false;
     m_transportHandler = transportHandler;
     m_requestId = requestId;
     m_callback = callback;
     m_clientConnection = connection;
     m_clientSinkStack = clientSinkStack;
     m_timeOut = timeOutMillis;
 }
Exemplo n.º 28
0
 /// <summary>creates a giop transport message handler, which accept request messages by delegating to receiver</summary>
 /// <param name="serverThreadsMaxPerConnection">
 /// the maximum number of server threads used for processing requests on a multiplexed client connection.
 /// </param>
 internal GiopReceivedRequestMessageDispatcher(IGiopRequestMessageReceiver receiver, GiopTransportMessageHandler msgHandler,
                                               GiopConnectionDesc conDesc, int serverThreadsMaxPerConnection) {
     m_serverCon = new GiopServerConnection(conDesc, this);
     if (receiver != null) {
         m_receiver = receiver;
     } else {
         throw new BAD_PARAM(400, CompletionStatus.Completed_MayBe);
     }
     m_msgHandler = msgHandler;
     if (serverThreadsMaxPerConnection < 1) {
         throw new BAD_PARAM(401, CompletionStatus.Completed_MayBe);
     }
     m_maxRequestsAllowedInParallel = serverThreadsMaxPerConnection;
 }
Exemplo n.º 29
0
 internal GiopConnectionDesc(GiopClientConnectionManager conManager,
                             GiopTransportMessageHandler transportHandler)
 {
     m_conManager       = conManager;
     m_transportHandler = transportHandler;
 }
Exemplo n.º 30
0
 internal GiopClientConnectionDesc(GiopClientConnectionManager conManager, GiopClientConnection connection,
                                   GiopRequestNumberGenerator reqNumberGen,
                                   GiopTransportMessageHandler transportHandler)
     : base(conManager, transportHandler)
 {
     m_reqNumGen = reqNumberGen;
     m_connection = connection;
 }