Base.USocket.ConnectAsync C# (CSharp) Method

ConnectAsync() public method

public ConnectAsync ( string host, ushort port ) : void
host string
port ushort
return void
		public void ConnectAsync(string host, ushort port)
		{
			UAddress address = new UAddress(host, port);
			ENetAddress nativeAddress = address.Struct;

			this.PeerPtr = NativeMethods.ENetHostConnect(this.poller.Host, ref nativeAddress, 2, 0);
			if (this.PeerPtr == IntPtr.Zero)
			{
				throw new Exception($"host connect call failed, {host}:{port}");
			}
			this.poller.USocketManager.Add(this.PeerPtr, this);
		}