/// <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); }
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("服务器连接失败!"); } }
public InterfaceFunctions(INetConnector connector, BufferQueue queue) { _queue = queue; _conn = connector; }