CGSF.TCPNetwork.AsyncConnect C# (CSharp) Method

AsyncConnect() public method

public AsyncConnect ( string ip, int port ) : bool
ip string
port int
return bool
        public bool AsyncConnect(string ip, int port)
        {
            //IPAddress ipAddress = IPAddress.Parse(ip);
            //IPEndPoint ipEndpoint = new IPEndPoint(ipAddress, port);

            //Asynchronous call
            IAsyncResult asyncConnect = tcp.BeginConnect(ip, port, connectCallback, null);

            return true;
        }

Usage Example

Example #1
0
 public void OnConnect()
 {
     network.AsyncConnect("127.0.0.1", 25251);
     connectionText.text = "Connecting...";
     outputScroll.GetComponentInChildren <Text>().text         = "sdffsdfdsd";
     outputScroll.GetComponentInChildren <Scrollbar>().enabled = true;
 }
All Usage Examples Of CGSF.TCPNetwork::AsyncConnect