Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using System.Net.Sockets;
  4. using System.Text;
  5.  
  6. namespace wincfg_server
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. TcpListener listener = new TcpListener(IPAddress.Any, 6378);
  13. listener.Start();
  14.  
  15. for (int i = 0; i < 5; i++)
  16. {
  17. Socket s = listener.AcceptSocket();
  18. ASCIIEncoding asen = new ASCIIEncoding();
  19. s.Send(asen.GetBytes("Test"));
  20. Console.WriteLine("CLOSED");
  21. s.Close();
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement