Skip to content

Instantly share code, notes, and snippets.

@alexischr
Created August 16, 2018 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexischr/f57083a870c54b95afd594e85d922616 to your computer and use it in GitHub Desktop.
Save alexischr/f57083a870c54b95afd594e85d922616 to your computer and use it in GitHub Desktop.
using System;
using System.Net.Sockets;
using System.Threading.Tasks;
public class Program {
public static void Main (string[] args)
{
Action<int> create_port = port => { var listener = TcpListener.Create (port); listener.Start(); };
for (int x = 0; x < 10; x++) {
var port = 1200 + x;
Task.Run (() => create_port (port));
}
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment