public void listenForConnections()
        {
            bool stopped = false;

            while (!stopped)
            {
                try
                {
                    listener.Start();

                    TcpClient     client        = listener.AcceptTcpClient();
                    SocketHandler socketHandler = new SocketHandler(client, this);

                    Thread thread = new Thread(new ThreadStart(socketHandler.handleSocket));
                    thread.Start();
                }
                catch (IOException e) { Console.Write(e.StackTrace); }
                catch (SocketException e) { stopped = true; }
            }
        }
 internal void registerSocketHandler(string greenhouseID, SocketHandler handler)
 {
     this.activeHandlers.Add(greenhouseID, handler);
 }