Exemple #1
0
        connect(Transport.ConnectionInfo connectionInfo,
                ElementListener elementListener, IRunnable onConnected)
        {
            close();

            socket_ = connectSocket
                          (((ConnectionInfo)connectionInfo).getHost(),
                          ((ConnectionInfo)connectionInfo).getPort());

            elementReader_ = new ElementReader(elementListener);

            if (onConnected != null)
            {
                onConnected.run();
            }
        }
Exemple #2
0
        connect(Transport.ConnectionInfo connectionInfo,
                ElementListener elementListener, IRunnable onConnected)
        {
            close();

            socket_ = connectSocket
                          (((ConnectionInfo)connectionInfo).getHost(),
                          ((ConnectionInfo)connectionInfo).getPort());

            if (socket_ != null)
            {
                elementReader_ = new ElementReader(elementListener);

                if (onConnected != null)
                {
                    onConnected.run();
                }

                // Begin a new receive.
                socket_.BeginReceive
                    (inputBuffer_.array(), 0, inputBuffer_.capacity(), 0,
                    new AsyncCallback(receiveCallback), null);
            }
        }
Exemple #3
0
 /// <summary>
 /// Create a new ElementReader with the elementListener.
 /// </summary>
 ///
 /// <param name="elementListener">The ElementListener used by onReceivedData.</param>
 public ElementReader(ElementListener elementListener)
 {
     this.tlvStructureDecoder_ = new TlvStructureDecoder();
     this.partialData_         = new DynamicByteBuffer(1000);
     elementListener_          = elementListener;
 }
 /// <summary>
 /// Create a new ElementReader with the elementListener.
 /// </summary>
 ///
 /// <param name="elementListener">The ElementListener used by onReceivedData.</param>
 public ElementReader(ElementListener elementListener)
 {
     this.tlvStructureDecoder_ = new TlvStructureDecoder();
     this.partialData_ = new DynamicByteBuffer(1000);
     elementListener_ = elementListener;
 }
        /// <summary>
        /// Connect according to the info in ConnectionInfo, and use elementListener.
        /// </summary>
        ///
        /// <param name="connectionInfo">A TcpTransport.ConnectionInfo.</param>
        /// <param name="elementListener"></param>
        /// <param name="onConnected"></param>
        /// <exception cref="IOException">For I/O error.</exception>
        public override void connect(Transport.ConnectionInfo connectionInfo,
      ElementListener elementListener, IRunnable onConnected)
        {
            close();

              socket_ = connectSocket
            (((ConnectionInfo)connectionInfo).getHost(),
             ((ConnectionInfo)connectionInfo).getPort());

              elementReader_ = new ElementReader(elementListener);

              if (onConnected != null)
            onConnected.run();
        }
Exemple #6
0
 /// <summary>
 /// Connect according to the info in ConnectionInfo, and use elementListener.
 /// </summary>
 ///
 /// <param name="connectionInfo">An object of a subclass of ConnectionInfo.</param>
 /// <param name="elementListener"></param>
 /// <param name="onConnected"></param>
 /// <exception cref="IOException">For I/O error.</exception>
 public virtual void connect(Transport.ConnectionInfo connectionInfo,
                             ElementListener elementListener, IRunnable onConnected)
 {
     throw new NotSupportedException("connect is not implemented");
 }
Exemple #7
0
        /// <summary>
        /// Connect according to the info in ConnectionInfo, and use elementListener.
        /// </summary>
        ///
        /// <param name="connectionInfo">An object of a subclass of ConnectionInfo.</param>
        /// <param name="elementListener"></param>
        /// <param name="onConnected"></param>
        /// <exception cref="IOException">For I/O error.</exception>
        public virtual void connect(Transport.ConnectionInfo connectionInfo,
				ElementListener elementListener, IRunnable onConnected)
        {
            throw new NotSupportedException("connect is not implemented");
        }