コード例 #1
0
 public void StartVncServer()
 {
     try
     {
         var settings = new Settings();
         var vncProxyPort = settings.Read("Vnc", "VncProxyPort", 5901);
         var vncPort = settings.Read("Vnc", "VncPort", 5900);
         var vncPass = settings.Read("Vnc", "VncPass", "");
         vncServer = new VncServer(vncPass, vncProxyPort, vncPort, "Ulterius VNC");
         Task.Run(() => { vncServer.Start(); });
         var endData = new
         {
             vncStarted = true,
             proxyPort = vncProxyPort,
             port = vncPort,
             message = "VNC Server Started"
         };
         serializator.Serialize(_client, packet.endpoint, packet.syncKey, endData);
     }
     catch (ArgumentNullException)
     {
         vncServer?.Stop();
     }
 }
コード例 #2
0
 public static void Start()
 {
     AllClients = new ConcurrentDictionary<string, AuthClient>();
     ApiControllers = new ConcurrentDictionary<string, ApiController>();
     var settings = new Settings();
     var port = settings.Read("TaskServer", "TaskServerPort", 8387);
     var cancellation = new CancellationTokenSource();
     var endpoint = new IPEndPoint(IPAddress.Parse(/*NetworkUtilities.GetIPv4Address()*/ "0.0.0.0"), port);
     var server = new WebSocketEventListener(endpoint);
     server.OnConnect += HandleConnect;
     server.OnDisconnect += HandleDisconnect;
     server.OnMessage += HandleMessage;
     server.OnError += HandleError;
     server.Start();
     Log("Task TServer started at " + endpoint);
 }
コード例 #3
0
ファイル: HttpServer.cs プロジェクト: cron410/ulterius-server
 public static void Setup()
 {
     var settings = new Settings();
     var useWebServer = settings.Read("WebServer", "UseWebServer", false);
     if (useWebServer)
     {
         var root = settings.Read("WebServer", "WebFilePath", "");
         var port = settings.Read("WebServer", "WebServerPort", 9999);
         var httpServer = new HttpServer(root, port);
         Console.WriteLine(Resources.Program_Main_Web_Server_is_running_on_this_port__ + httpServer.Port);
     }
 }