public Network(bool workerMode)
 {
     this.workerMode = workerMode;
     this.ipAddress = "127.0.0.1";
     worker = new RemoteWorker(ipAddress, port);
     host = new Host(port);
 }
        public Network(bool workerMode, string ipAddress)
        {
            this.workerMode = workerMode;
            this.ipAddress = ipAddress;
            worker = new RemoteWorker(ipAddress, port);
            host = new Host(port);

        }
 public void start()
 {
     if (workerMode)
     {
         worker = new RemoteWorker(ipAddress, port);
         worker.start();
     }
     else
     {
         host = new Host(port);
         host.start();
     }
 }