using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; using System.Net.Sockets; namespace KnockKnock.Lib { internal class Upstream { IPAddress ip; int port; public Upstream(IPAddress ip, int port) { this.ip = ip; this.port = port; } public Socket Connect() { Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); s.Connect(this.ip, this.port); return s; } } }