public BlockingSocketProcessor(string host, int port, IProtocolListener protocolListener)
 {
     _host             = host;
     _port             = port;
     _protocolListener = protocolListener;
     _byteChannel      = new ByteChannel(this);
 }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="listener"></param>
 public void AddListener(IProtocolListener listener)
 {
     if (!this.listenerList.Contains(listener))
     {
         listenerList.Add(listener);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a listener to the friend events
 /// </summary>
 /// <param name="listener"></param>
 internal void AddListener(IProtocolListener listener)
 {
     if (!this.listeners.Contains(listener))
     {
         this.listeners.Add(listener);
     }
 }
Ejemplo n.º 4
0
      public ProtocolDecoderOutput(IProtocolListener protocolListener)
      {
         if ( protocolListener == null )
            throw new ArgumentNullException("protocolListener");

         _protocolListener = protocolListener;
      }
        public ProtocolDecoderOutput(IProtocolListener protocolListener)
        {
            if (protocolListener == null)
            {
                throw new ArgumentNullException("protocolListener");
            }

            _protocolListener = protocolListener;
        }
Ejemplo n.º 6
0
      /// <summary>
      /// Initialize a new instance
      /// </summary>
      /// <param name="stream">Underlying network stream</param>
      /// <param name="protocolListener">Protocol listener to report exceptions to</param>
      public IoHandler(Stream stream, IProtocolListener protocolListener)
      {
         if ( stream == null )
            throw new ArgumentNullException("stream");
         if ( protocolListener == null )
            throw new ArgumentNullException("protocolListener");

         // initially, the stream at the top of the filter 
         // chain is the underlying network stream
         _topStream = stream;
         _protocolListener = protocolListener;
         _readBufferSize = DEFAULT_BUFFER_SIZE;
      }
      /// <summary>
      /// Connect to the specified broker
      /// </summary>
      /// <param name="broker">The broker to connect to</param>
      /// <param name="connection">The AMQ connection</param>
      public void Connect(IBrokerInfo broker, AMQConnection connection)
      {
         _stopEvent = new ManualResetEvent(false);
         _protocolListener = connection.ProtocolListener;

         _ioHandler = MakeBrokerConnection(broker, connection);
         // todo: get default read size from config!

         IProtocolDecoderOutput decoderOutput =
            new ProtocolDecoderOutput(_protocolListener);
         _amqpChannel = 
            new AmqpChannel(new ByteChannel(_ioHandler), decoderOutput);

         // post an initial async read
         _amqpChannel.BeginRead(new AsyncCallback(OnAsyncReadDone), this);
      }
Ejemplo n.º 8
0
        /// <summary>
        /// Initialize a new instance
        /// </summary>
        /// <param name="stream">Underlying network stream</param>
        /// <param name="protocolListener">Protocol listener to report exceptions to</param>
        public IoHandler(Stream stream, IProtocolListener protocolListener)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (protocolListener == null)
            {
                throw new ArgumentNullException("protocolListener");
            }

            // initially, the stream at the top of the filter
            // chain is the underlying network stream
            _topStream        = stream;
            _protocolListener = protocolListener;
            _readBufferSize   = DEFAULT_BUFFER_SIZE;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Connect to the specified broker
        /// </summary>
        /// <param name="broker">The broker to connect to</param>
        /// <param name="connection">The AMQ connection</param>
        public void Connect(IBrokerInfo broker, AMQConnection connection)
        {
            _stopEvent        = new ManualResetEvent(false);
            _protocolListener = connection.ProtocolListener;

            _ioHandler = MakeBrokerConnection(broker, connection);
            // todo: get default read size from config!

            IProtocolDecoderOutput decoderOutput =
                new ProtocolDecoderOutput(_protocolListener);

            _amqpChannel =
                new AmqpChannel(new ByteChannel(_ioHandler), decoderOutput);

            // post an initial async read
            _amqpChannel.BeginRead(new AsyncCallback(OnAsyncReadDone), this);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="o"></param>
 public void Remove(IProtocolListener o)
 {
     this.arrayList.Remove(o);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="index"></param>
 /// <param name="o"></param>
 public void Insert(int index, IProtocolListener o)
 {
     this.arrayList.Insert(index, o);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public int IndexOf(IProtocolListener o)
 {
     return this.arrayList.IndexOf(o);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public bool Contains(IProtocolListener o)
 {
     return this.arrayList.Contains(o);
 }
Ejemplo n.º 14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="listener"></param>
 public void RemoveListener(IProtocolListener listener)
 {
     listenerList.Remove(listener);
 }
Ejemplo n.º 15
0
 public BlockingSocketTransport(string host, int port, AMQConnection connection)
 {
     _host = host;
     _port = port;
     _protocolListener = connection.ProtocolListener;
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Adds a listener to the friend events
 /// </summary>
 /// <param name="listener"></param>
 internal void AddListener(IProtocolListener listener)
 {
     if (!this.listeners.Contains(listener))
         this.listeners.Add(listener);
 }
Ejemplo n.º 17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public bool Contains(IProtocolListener o)
 {
     return(this.arrayList.Contains(o));
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Remove a listener from the protocol.
 /// </summary>
 /// <param name="listener"></param>
 public void RemoveListener(IProtocolListener listener)
 {
     this.protocolServer.RemoveListener(listener);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Add a listener to the protocol. The listeners receive events triggered by the plugin.
 /// </summary>
 /// <param name="listener"></param>
 public void AddListener(IProtocolListener listener)
 {
     this.protocolServer.AddListener(listener);
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Removes a listener from the friend events
 /// </summary>
 /// <param name="listener"></param>
 internal void RemoveListener(IProtocolListener listener)
 {
     this.listeners.Remove(listener);
 }
Ejemplo n.º 21
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public int IndexOf(IProtocolListener o)
 {
     return(this.arrayList.IndexOf(o));
 }
Ejemplo n.º 22
0
 public ProtocolWriter(IProtocolWriter protocolWriter, IProtocolListener protocolListener)
 {
     _protocolWriter = protocolWriter;
     _protocolListener = protocolListener;
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="listener"></param>
 public void AddListener(IProtocolListener listener)
 {
     if (!this.listenerList.Contains(listener))
         listenerList.Add(listener);
 }
 public BlockingSocketTransport(string host, int port, AMQConnection connection)
 {
     _host             = host;
     _port             = port;
     _protocolListener = connection.ProtocolListener;
 }
 public ProtocolWriter(IProtocolWriter protocolWriter, IProtocolListener protocolListener)
 {
     _protocolWriter   = protocolWriter;
     _protocolListener = protocolListener;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Removes a listener from the friend events
 /// </summary>
 /// <param name="listener"></param>
 internal void RemoveListener(IProtocolListener listener)
 {
     this.listeners.Remove(listener);
 }
Ejemplo n.º 27
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="index"></param>
 /// <param name="o"></param>
 public void Insert(int index, IProtocolListener o)
 {
     this.arrayList.Insert(index, o);
 }
Ejemplo n.º 28
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="listener"></param>
 public void RemoveListener(IProtocolListener listener)
 {
     listenerList.Remove(listener);
 }
Ejemplo n.º 29
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public int Add(IProtocolListener o)
 {
     return this.arrayList.Add(o);
 }
Ejemplo n.º 30
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public int Add(IProtocolListener o)
 {
     return(this.arrayList.Add(o));
 }
Ejemplo n.º 31
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="o"></param>
 public void Remove(IProtocolListener o)
 {
     this.arrayList.Remove(o);
 }