private void ConnectMyPeer() { try { // P2P Start Listening this.p2pManager.StartListening(); } catch (Exception e) { Glue.Dialogs.MessageError("P2P Starting Error", e.Message); // ReTrow Exception throw(e); } try { // Initialize Download & Upload Manager DownloadManager.Initialize(); UploadManager.Initialize(); } catch (Exception e) { Glue.Dialogs.MessageError("Download/Upload Manager Init", e.Message); // P2P Stop Listening this.p2pManager.StopListening(); // ReTrow Exception throw(e); } try { // Initialize Command Manager & Add Commands Handler this.cmdManager.AddPeerEventsHandler(); this.AddProtocolEvents(); // Add Custom Command Handler if (AddProtocolEvent != null) { AddProtocolEvent(p2pManager, cmdManager); } } catch (Exception e) { Glue.Dialogs.MessageError("Add Protocol Events", e.Message); // P2P Stop Listening this.p2pManager.StopListening(); // ReTrow Exception throw(e); } try { // Connect To NyFolder Web Server MyInfo.ConnectToWebServer(this.p2pManager.CurrentPort); } catch (Exception e) { Glue.Dialogs.MessageError("Connect To Web Server", e.Message); // P2P Stop Listening this.p2pManager.StopListening(); // ReTrow Exception throw(e); } }
private void ConnectToWebServer() { try { // Connect To NyFolder Web Server MyInfo.ConnectToWebServer(this.p2pManager.CurrentPort); } catch (Exception e) { Base.Dialogs.MessageError("Connect To Web Server", e.Message); // P2P Stop Listening this.p2pManager.StopListening(); // ReTrow Exception throw(e); } }