damongant

Untitled

Dec 25th, 2011
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. listener = new TcpListener(IPAddress.Any, 80);
  2. var currentAcceptTcpClient = listener.BeginAcceptTcpClient(null, null);
  3. while (true)
  4. {
  5. foreach (TcpClient client in clients)
  6. {
  7. if (client.Available > 4)
  8. {
  9. //BLABLA PROCESS SHIT
  10. }
  11. }
  12.  
  13. if (currentAcceptTcpClient.IsCompleted)
  14. {
  15. clients.Add(listener.EndAcceptTcpClient(currentAcceptTcpClient));
  16. currentAcceptTcpClient = listener.BeginAcceptTcpClient(null, null);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment