Пример #1
0
        /// <summary>
        /// 创建指定IP指定端口的链接
        /// </summary>
        /// <param name="_IPEndPoint"></param>
        private void CreateClient(System.Net.IPEndPoint _IPEndPoint)
        {
            INetConnector connector = null;

            connector = NetConnectionCreatorFactory.CreateTcpConnector(_IPEndPoint, 1024 * 1024, "");
            _client.AddConnector(connector, _callback);
        }
Пример #2
0
    public void UpdateConnection()
    {
        INetConnector    lobbyConnection = NetSystem.Instance.GetConnector((int)NetCtr.Lobby);
        ConnectionStatus status          = lobbyConnection.GetConnectStatus();

        if (status == ConnectionStatus.CONNECTING)
        {
            // 连接中。。。
            Debug.Log("服务器连接中。。。");
        }
        else if (status == ConnectionStatus.CONNECTED)
        {
            // 开始登录

            CancelInvoke("UpdateConnection");
        }
        else
        {
            Debug.Log("服务器连接失败!");
        }
    }
Пример #3
0
 public InterfaceFunctions(INetConnector connector, BufferQueue queue)
 {
     _queue = queue;
     _conn  = connector;
 }