ConnectAsync() public method

public ConnectAsync ( string Host, int Port ) : Task
Host string
Port int
return Task
Ejemplo n.º 1
0
		/*
		public event Action Connected;
		public event Action Data;
		public event Action Disconnected;
		*/

		async static public Task<TcpSocket> CreateAndConnectAsync(string Host, int Port, int BufferSize = NodeBufferedStream.DefaultBufferSize)
		{
			var TcpSocket = new TcpSocket(new SystemTcpClient(), BufferSize);
			await TcpSocket.ConnectAsync(Host, Port);
			return TcpSocket;
		}