public Server(CallResponseQueue queue) { this.queue = queue; this.tcpListener = new TcpListener(IPAddress.Loopback, 3000); this.listenThread = new Thread(new ThreadStart(ListenForClients)); this.listenThread.Start(); }
void Start() { Debug.Log("Listening for clients..."); queue = new CallResponseQueue(); server = new Server(queue); }
void OnEnable() { //Debug.Log ("Called OnEnable - StartServer"); queue = new CallResponseQueue(); server = new Server(queue); //Debug.Log ("New Server's application running: " + server.applicationRunning.ToString()); }
public Server(CallResponseQueue queue) { //Debug.Log ("In constructor for Server, setting applicationRunning to true"); //Debug.Log ("Killing any existing Servers...currInstance = " + currInstance); if (currInstance != null) { currInstance.tcpListener.Stop(); // Kill the old listener so it doesn't interfere with new spells } currInstance = this; applicationRunning = true; this.queue = queue; if (this.tcpListener != null) { //Debug.Log ("Killing accept socket"); this.tcpListener.Stop(); } this.tcpListener = new TcpListener(IPAddress.Loopback, 3000); this.listenThread = new Thread(new ThreadStart(ListenForClients)); this.listenThread.IsBackground = true; this.listenThread.Start(); }
public void setParent(CallResponseQueue crq) { parent = crq; }