public BlockingSocketProcessor(string host, int port, IProtocolListener protocolListener)
 {
     _host             = host;
     _port             = port;
     _protocolListener = protocolListener;
     _byteChannel      = new ByteChannel(this);
 }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="listener"></param>
 public void AddListener(IProtocolListener listener)
 {
     if (!this.listenerList.Contains(listener))
     {
         listenerList.Add(listener);
     }
 }
Example #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);
     }
 }
      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;
        }
Example #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);
      }
Example #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;
        }
Example #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);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="o"></param>
 public void Remove(IProtocolListener o)
 {
     this.arrayList.Remove(o);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="index"></param>
 /// <param name="o"></param>
 public void Insert(int index, IProtocolListener o)
 {
     this.arrayList.Insert(index, o);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public int IndexOf(IProtocolListener o)
 {
     return this.arrayList.IndexOf(o);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public bool Contains(IProtocolListener o)
 {
     return this.arrayList.Contains(o);
 }
Example #14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="listener"></param>
 public void RemoveListener(IProtocolListener listener)
 {
     listenerList.Remove(listener);
 }
 public BlockingSocketTransport(string host, int port, AMQConnection connection)
 {
     _host = host;
     _port = port;
     _protocolListener = connection.ProtocolListener;
 }
Example #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);
 }
Example #17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public bool Contains(IProtocolListener o)
 {
     return(this.arrayList.Contains(o));
 }
Example #18
0
 /// <summary>
 /// Remove a listener from the protocol.
 /// </summary>
 /// <param name="listener"></param>
 public void RemoveListener(IProtocolListener listener)
 {
     this.protocolServer.RemoveListener(listener);
 }
Example #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);
 }
Example #20
0
 /// <summary>
 /// Removes a listener from the friend events
 /// </summary>
 /// <param name="listener"></param>
 internal void RemoveListener(IProtocolListener listener)
 {
     this.listeners.Remove(listener);
 }
Example #21
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public int IndexOf(IProtocolListener o)
 {
     return(this.arrayList.IndexOf(o));
 }
Example #22
0
 public ProtocolWriter(IProtocolWriter protocolWriter, IProtocolListener protocolListener)
 {
     _protocolWriter = protocolWriter;
     _protocolListener = protocolListener;
 }
 /// <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;
 }
Example #26
0
 /// <summary>
 /// Removes a listener from the friend events
 /// </summary>
 /// <param name="listener"></param>
 internal void RemoveListener(IProtocolListener listener)
 {
     this.listeners.Remove(listener);
 }
Example #27
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="index"></param>
 /// <param name="o"></param>
 public void Insert(int index, IProtocolListener o)
 {
     this.arrayList.Insert(index, o);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="listener"></param>
 public void RemoveListener(IProtocolListener listener)
 {
     listenerList.Remove(listener);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public int Add(IProtocolListener o)
 {
     return this.arrayList.Add(o);
 }
Example #30
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public int Add(IProtocolListener o)
 {
     return(this.arrayList.Add(o));
 }
Example #31
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="o"></param>
 public void Remove(IProtocolListener o)
 {
     this.arrayList.Remove(o);
 }