Inheritance: IConnection
 public QuiescingSession(ConnectionBase connection,
                         int channelNumber,
                         ShutdownEventArgs reason)
     : base(connection, channelNumber)
 {
     m_reason = reason;
 }
Ejemplo n.º 2
0
 public SessionBase(ConnectionBase connection, int channelNumber)
 {
     m_connection = connection;
     m_channelNumber = channelNumber;
     if (channelNumber != 0)
         connection.ConnectionShutdown +=
             new ConnectionShutdownEventHandler(this.OnConnectionShutdown);
 }
 public QuiescingSession(ConnectionBase connection,
                         int channelNumber,
                         ShutdownEventArgs reason,
                         int replyClassId,
                         int replyMethodId)
     : base(connection, channelNumber)
 {
     m_reason = reason;
     m_replyClassId = replyClassId;
     m_replyMethodId = replyMethodId;
 }
Ejemplo n.º 4
0
 public MainSession(ConnectionBase connection)
     : base(connection, 0)
 {
     Command request;
     connection.Protocol.CreateConnectionClose(0,"",
                                               out request,
                                               out m_closeOkClassId,
                                               out m_closeOkMethodId);
     m_closeClassId = request.Method.ProtocolClassId;
     m_closeMethodId = request.Method.ProtocolMethodId;
 }
Ejemplo n.º 5
0
 public Session(ConnectionBase connection, int channelNumber)
     : base(connection, channelNumber)
 {
     m_assembler = new CommandAssembler(connection.Protocol);
 }
Ejemplo n.º 6
0
        public void Transmit(int channelNumber, ConnectionBase connection)
        {
            Frame frame = new Frame(CommonFraming.Constants.FrameMethod, channelNumber);
            NetworkBinaryWriter writer = frame.GetWriter();
            writer.Write((ushort) m_method.ProtocolClassId);
            writer.Write((ushort) m_method.ProtocolMethodId);
            MethodArgumentWriter argWriter = new MethodArgumentWriter(writer);
            m_method.WriteArgumentsTo(argWriter);
            argWriter.Flush();
            connection.WriteFrame(frame);

            if (m_method.HasContent) {
                byte[] body = Body;

                frame = new Frame(CommonFraming.Constants.FrameHeader, channelNumber);
                writer = frame.GetWriter();
                writer.Write((ushort) m_header.ProtocolClassId);
                m_header.WriteTo(writer, (ulong) body.Length);
                connection.WriteFrame(frame);

                int frameMax = (int) Math.Min(int.MaxValue, connection.FrameMax);
                int bodyPayloadMax = (frameMax == 0)
                    ? body.Length
                    : frameMax - EmptyFrameSize;
                for (int offset = 0; offset < body.Length; offset += bodyPayloadMax) {
                    int remaining = body.Length - offset;

                    frame = new Frame(CommonFraming.Constants.FrameBody, channelNumber);
                    writer = frame.GetWriter();
                    writer.Write(body, offset,
                                 (remaining < bodyPayloadMax) ? remaining : bodyPayloadMax);
                    connection.WriteFrame(frame);
                }
            }
        }
 public SessionManager(ConnectionBase connection, ushort channelMax)
 {
     m_connection = connection;
     ChannelMax = (channelMax == 0) ? ushort.MaxValue : channelMax;
     Ints = new IntAllocator(1, ChannelMax);
 }
 public SessionManager(ConnectionBase connection)
 {
     m_connection = connection;
 }
 public Session(ConnectionBase connection, int channelNumber)
     : base(connection, channelNumber)
 {
     m_assembler = new CommandAssembler(connection.Protocol);
 }
Ejemplo n.º 10
0
 public SessionManager(ConnectionBase connection)
 {
     m_connection = connection;
 }