Skip to content

Instantly share code, notes, and snippets.

@deostroll
Created March 31, 2015 07:19
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 deostroll/80909858c42e00c8079f to your computer and use it in GitHub Desktop.
Save deostroll/80909858c42e00c8079f to your computer and use it in GitHub Desktop.
bool listen = true;
TcpListener listener = GetListener();
listener.Start();
while(listen)
{
if(!listener.Pending())
{
Thread.Sleep(500); //why?! and why only 500
continue;
}
else
{
//accept socket and do something...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment