示例#1
0
 protected void Initalize(string connectionKey, GiopTransportMessageHandler transportHandler,
                          GiopClientConnectionDesc assocDesc)
 {
     m_connectionKey    = connectionKey;
     m_assocDesc        = assocDesc;
     m_transportHandler = transportHandler;
 }
示例#2
0
 internal GiopClientConnectionDesc(GiopClientConnectionManager conManager, GiopClientConnection connection,
                                   GiopRequestNumberGenerator reqNumberGen,
                                   GiopTransportMessageHandler transportHandler)
     : base(conManager, transportHandler)
 {
     m_reqNumGen  = reqNumberGen;
     m_connection = connection;
 }
示例#3
0
 internal AsynchronousResponseWaiter(GiopTransportMessageHandler transportHandler,
                                     uint requestId,
                                     AsyncResponseAvailableCallBack callback,
                                     IClientChannelSinkStack clientSinkStack,
                                     GiopClientConnection connection,
                                     MessageTimeout timeOut)
 {
     Initalize(transportHandler, requestId, callback, clientSinkStack, connection, timeOut);
 }
示例#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);
        }
示例#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
        }
示例#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);
        }
示例#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;
 }
示例#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;
 }
示例#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 ...
 }
示例#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);
     }
 }
示例#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);
     }
 }
示例#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();
 }
示例#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);
     }
 }
示例#14
0
 public SynchronousResponseWaiter(GiopTransportMessageHandler handler)
 {
     m_waiter  = new ManualResetEvent(false);
     m_handler = handler;
 }
示例#15
0
 public MessageSendTask(ITransport onTransport,
                        GiopTransportMessageHandler messageHandler) {
     Initalize(onTransport, messageHandler);
 }
示例#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);
 }
示例#17
0
 public MessageSendTask(ITransport onTransport,
                        GiopTransportMessageHandler messageHandler)
 {
     Initalize(onTransport, messageHandler);
 }
示例#18
0
 protected void Initalize(string connectionKey, GiopTransportMessageHandler transportHandler,
                          GiopClientConnectionDesc assocDesc)
 {
     m_connectionKey = connectionKey;
     m_assocDesc = assocDesc;
     m_transportHandler = transportHandler;
 }
示例#19
0
 internal AsynchronousResponseWaiter(GiopTransportMessageHandler transportHandler,
                                     uint requestId,
                                     AsyncResponseAvailableCallBack callback,
                                     IClientChannelSinkStack clientSinkStack,
                                     GiopClientConnection connection,
                                     MessageTimeout timeOut) {
     Initalize(transportHandler, requestId, callback, clientSinkStack, connection, timeOut);
 }
示例#20
0
 public SynchronousResponseWaiter(GiopTransportMessageHandler handler) {
     m_waiter = new ManualResetEvent(false);
     m_handler = handler;
 }
示例#21
0
 public MessageReceiveTask(ITransport onTransport,
                           GiopTransportMessageHandler messageHandler) {
     m_onTransport = onTransport;
     m_messageHandler = messageHandler;
 }
示例#22
0
 private void Initalize(ITransport onTransport,
                        GiopTransportMessageHandler messageHandler) {
     m_onTransport = onTransport;
     m_messageHandler = messageHandler;
 }
示例#23
0
 internal GiopConnectionDesc(GiopClientConnectionManager conManager,
                            GiopTransportMessageHandler transportHandler)
 {
     m_conManager = conManager;
     m_transportHandler = transportHandler;
 }
示例#24
0
 private void Initalize(ITransport onTransport,
                        GiopTransportMessageHandler messageHandler)
 {
     m_onTransport    = onTransport;
     m_messageHandler = messageHandler;
 }
示例#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);
 }
示例#26
0
 public MessageReceiveTask(ITransport onTransport,
                           GiopTransportMessageHandler messageHandler)
 {
     m_onTransport    = onTransport;
     m_messageHandler = messageHandler;
 }
示例#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;
 }
示例#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;
 }
示例#29
0
 internal GiopConnectionDesc(GiopClientConnectionManager conManager,
                             GiopTransportMessageHandler transportHandler)
 {
     m_conManager       = conManager;
     m_transportHandler = transportHandler;
 }
示例#30
0
 internal GiopClientConnectionDesc(GiopClientConnectionManager conManager, GiopClientConnection connection,
                                   GiopRequestNumberGenerator reqNumberGen,
                                   GiopTransportMessageHandler transportHandler)
     : base(conManager, transportHandler)
 {
     m_reqNumGen = reqNumberGen;
     m_connection = connection;
 }