Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using System.Net.Sockets;
  4. using System.Threading;
  5. using UnityEngine;
  6. using System.Threading.Tasks;
  7.  
  8. // Token: 0x020009B0 RID: 2480
  9. public partial class Testing_one {
  10. // Token: 0x060052EF RID: 21231 RVA: 0x0014A9DC File Offset: 0x00148BDC
  11. public async void Init() {
  12. await Task.Run(() => {
  13. try {
  14. ServerInit._listener = new TcpListener(IPAddress.Parse("127.0.0.1"), 8888);
  15. ServerInit._listener.Start();
  16. Console.WriteLine("Ожидание подключений...");
  17.  
  18. while (true) {
  19. TcpClient client = ServerInit._listener.AcceptTcpClient();
  20. ClientObject clientObject = new ClientObject(client);
  21.  
  22. // создаем новый поток для обслуживания нового клиента
  23. Thread clientThread = new Thread(clientObject.Process);
  24. clientThread.Start();
  25. }
  26. } catch (Exception ex) {
  27. Console.WriteLine(ex.Message);
  28. } finally {
  29. ServerInit._listener ? .Stop();
  30. }
  31. }
  32. }
  33. }
  34.  
  35. ERROR the specified task name does not exist;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement