public void ConnectServer(string hostNameOrAddress, int port, TcpSocketInvokeElement invokeElement) { #if DEBUG_NETIO UnityEngine.Debug.Log(string.Format("Connect :{0} {1}", hostNameOrAddress, port)); #endif Interlocked.Exchange(ref tcpSocketState, 0); tcpClient.ConnectServer(hostNameOrAddress, port, invokeElement); }