Created
March 31, 2015 07:19
-
-
Save deostroll/80909858c42e00c8079f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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