Example #1
0
 /// <summary>
 /// Creates a connection from a GUI to the bot
 /// </summary>
 /// <param name="token">The token that specifies how to connect to the bot</param>
 public Connection(Listener.LogDelegate log, Token token)
 {
     this.log = log;
     State = ConnectionState.Connecting;
     worker = new Thread(new ParameterizedThreadStart(client_Connect));
     worker.Start(token);
 }
Example #2
0
 /// <summary>
 /// Creates a connection form the bot to a GUI
 /// </summary>
 /// <param name="source">The listener on the bot side</param>
 /// <param name="client">The TCP connection to the GUI</param>
 internal Connection(Listener source, TcpClient client)
 {
     State = ConnectionState.Authing;
     this.client = client;
     this.source = source;
     worker = new Thread(new ThreadStart(client_Listen));
     worker.Start();
 }