// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Net; using System.Net.Sockets; namespace E { public class Program { public static void XConnect(String localip, int localport, String remoteip, int remoteport) { Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); s.Bind(new IPEndPoint(IPAddress.Parse(localip), localport)); s.Connect(new IPEndPoint(IPAddress.Parse(remoteip), remoteport)); s.Close(); } public static void Main(string[] args) { XConnect("192.168.0.130", 7000, "192.168.0.130", 1234); XConnect("192.168.0.131", 7000, "192.168.0.130", 1234); } } }