コード例 #1
0
ファイル: VideoSync.cs プロジェクト: michaelbehner96/Xyzzxyz
        public void StartHosting()
        {
            try
            {
                if (IsHosting)
                {
                    HostedServer.Stop();
                    SyncTimer.Stop();
                }

                HostedServer = new Server(HostPort);
                HostedServer.Start();
                HostedServer.Input += OnHostInput;
                HostedServer.Output += OnHostOutput;
                HostedServer.Connect += OnHostConnect;
                HostedServer.Disconnect += OnHostDisconnect;
                SyncTimer.Start();
            }
            catch (Exception e)
            {
                StopHosting();
                Debug.Log(e);
            }
        }
コード例 #2
0
 private void OnLoad(object sender, EventArgs e)
 {
     Server = new Server(25564);
     Server.Start();
 }