TexeL

Untitled

Jun 9th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1.     public void Start()
  2.  
  3.     {
  4.  
  5.         listenerThread = new Thread(new ThreadStart(DoListen));
  6.  
  7.         listenerThread.Start();
  8.  
  9.     }
  10.  
  11.  
  12.  
  13.     // This subroutine is used a background listener thread to allow reading incoming
  14.  
  15.     // messages without lagging the user interface.
  16.  
  17.     private void DoListen()
  18.  
  19.     {
  20.  
  21.         try {
  22.  
  23.             // Listen for new connections.
  24.  
  25.             listener = new TcpListener(System.Net.IPAddress.Any, Port);
  26.  
  27.             listener.Start();
  28.  
  29.  
  30.  
  31.             do
  32.  
  33.             {
  34.  
  35.                 Debug.Log("Listen");
  36.  
  37.             }
  38.  
  39.             while(true);
  40.  
  41.         }
  42.  
  43.         catch(Exception ex)
  44.  
  45.         {
  46.  
  47.             //MessageBox.Show(ex.ToString());
  48.  
  49.         }
  50.  
  51.     }
Advertisement
Add Comment
Please, Sign In to add comment