示例#1
0
 public CommonNetwork()
 {
     socket = new SocketBase();
     GameEventHandler.Instance.AddHandler(this, SocketBase.SOCKET_CONNECTED, OnSocketConnect);
     GameEventHandler.Instance.AddHandler(this, SocketBase.SOCKET_CLOSED, OnSocketClose);
     socket.Connect("localhost", 1213, "ws");
 }
 public virtual void Connect()
 {
     m_socketService.Connect();
 }
示例#3
0
        /// <summary>
        /// Connect the socket to <paramref name="address"/>.
        /// </summary>
        /// <param name="address">a string denoting the address to connect this socket to</param>
        /// <exception cref="ObjectDisposedException">thrown if the socket was already disposed</exception>
        /// <exception cref="TerminatingException">The socket has been stopped.</exception>
        /// <exception cref="NetMQException">No IO thread was found.</exception>
        /// <exception cref="AddressAlreadyInUseException">The specified address is already in use.</exception>
        public void Connect(string address)
        {
            m_socketHandle.CheckDisposed();

            m_socketHandle.Connect(address);
        }