public Listener(State state) { Thread = new Thread(new ThreadStart(MainLoop)); Thread.SetApartmentState(ApartmentState.STA); Thread.Start(); State = state; Handler = new StateRpcHandler(State); }