コード例 #1
0
 private void DisconnectFromWebServer()
 {
     try {
         // Disconnect From NyFolder Web Server
         MyInfo.DisconnectFromWebServer();
     } catch (Exception e) {
         Base.Dialogs.MessageError("Disconnection From Web Server", e.Message);
     }
 }
コード例 #2
0
        private void DisconnectMyPeer()
        {
            try {
                // Disconnect From NyFolder Web Server
                MyInfo.DisconnectFromWebServer();
            } catch (Exception e) {
                Glue.Dialogs.MessageError("Disconnection From Web Server", e.Message);
            }

            try {
                // Remove All Connected Users
                this.RemoveAllUsers();

                // Remove Custom Command Handler
                if (DelProtocolEvent != null)
                {
                    DelProtocolEvent(p2pManager, cmdManager);
                }

                // Reset Command Manager & Del Commands Handler
                this.DelProtocolEvents();
                this.cmdManager.DelPeerEventsHandler();
            } catch (Exception e) {
                Glue.Dialogs.MessageError("Remove Protocol Events", e.Message);
            }

            try {
                // Reset Download & Upload Manager
                UploadManager.Clear();
                DownloadManager.Clear();
            } catch (Exception e) {
                Glue.Dialogs.MessageError("Download/Upload Manager Stop", e.Message);
            }

            try {
                // P2P Stop Listening
                this.p2pManager.StopListening();
            } catch (Exception e) {
                Glue.Dialogs.MessageError("P2P Disconnection Error", e.Message);
            }
        }