{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/netmq/issues/481","repository_url":"https://api.github.com/repos/zeromq/netmq","labels_url":"https://api.github.com/repos/zeromq/netmq/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/netmq/issues/481/comments","events_url":"https://api.github.com/repos/zeromq/netmq/issues/481/events","html_url":"https://github.com/zeromq/netmq/issues/481","id":132406255,"number":481,"title":"Publisher using PGM crashes when I unplug the Ethernet cable and send a message","user":{"login":"joaoantunes","id":224836,"avatar_url":"https://avatars.githubusercontent.com/u/224836?v=3","gravatar_id":"","url":"https://api.github.com/users/joaoantunes","html_url":"https://github.com/joaoantunes","followers_url":"https://api.github.com/users/joaoantunes/followers","following_url":"https://api.github.com/users/joaoantunes/following{/other_user}","gists_url":"https://api.github.com/users/joaoantunes/gists{/gist_id}","starred_url":"https://api.github.com/users/joaoantunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaoantunes/subscriptions","organizations_url":"https://api.github.com/users/joaoantunes/orgs","repos_url":"https://api.github.com/users/joaoantunes/repos","events_url":"https://api.github.com/users/joaoantunes/events{/privacy}","received_events_url":"https://api.github.com/users/joaoantunes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-02-09T12:18:07Z","updated_at":"2016-03-03T19:13:15Z","closed_at":"2016-03-03T17:59:16Z","body":"Hi,\r\n\r\nI'am trying to implement a Pub/Sub and after looking for the different alternatives, I've chosen the PGM, because the Reliable offered (out of the box) seems to fit to my requisites.\r\n\r\nI've made some simple tests and all seems to be working, except when I created a Publisher, sent some messages, then unplugged the Ethernet and tried to sent another message and it crashed :(\r\n\r\nWhen using TrySendFrame extension when there was no internet, I was expecting to received a False instead. I've also tried to use Timeout but the result was the same.\r\nMy application can't crash if it tries to send a message but it was not possible, I can lose the message, but the program can't crash.\r\n\r\nAny suggestion how I should address this problem? I would like to graciously handle the fact that the message was not possible to be sent.\r\n\r\nA similar thing happened when I tried to create a publisher without having internet.\r\n\r\nI've tried the same with the subscriber and it worked well, but subscribers only Poll for new messages so it is a different case. \r\n\r\nThanks for your attention :)\r\n\r\nObs: I've made the tests on the Stable 3.3.2.2 version and the last one 3.3.3-rc4.\r\n\r\nHere is a sample code for 3.3.3-rc4 version:\r\n\r\n```\r\nprivate const int MEGA_BIT = 1024;\r\nprivate const int META_BYTE = 1024;\r\n\r\n        static void Main(string[] args)\r\n        {\r\n            try\r\n            {\r\n                using (var pub = new PublisherSocket())\r\n                {\r\n                    pub.Options.MulticastHops = 2;\r\n                    pub.Options.MulticastRate = 40 * MEGA_BIT; // 40 megabit\r\n                    pub.Options.MulticastRecoveryInterval = TimeSpan.FromMinutes(10);\r\n                    pub.Options.SendBuffer = META_BYTE * 10; // 10 megabyte\r\n\r\n                    pub.Connect(\"pgm://239.0.0.225:5554\");\r\n\r\n                    string input = null;\r\n                    while ((input = Console.ReadLine()) != \"quit\")\r\n                    {\r\n                        if (pub.TrySendFrame(input))\r\n                        {\r\n                            Console.WriteLine(string.Format(\"Message: {0} was sent\\n\", input));\r\n                        }\r\n                        else\r\n                        {\r\n                            Console.WriteLine(string.Format(\"Message: {0} was not sent\\n\", input));\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                Console.WriteLine(\"Exception: \" + ex.ToString());\r\n            }\r\n\r\n            Console.WriteLine(\"Press enter to terminate...\");\r\n            Console.ReadLine();\r\n        }\r\n```\r\n![pgmunplugtest](https://cloud.githubusercontent.com/assets/224836/12916275/fb6bdb56-cf28-11e5-92e2-42af2bc29187.png)\r\n"},"comment":{"url":"https://api.github.com/repos/zeromq/netmq/issues/comments/191920019","html_url":"https://github.com/zeromq/netmq/issues/481#issuecomment-191920019","issue_url":"https://api.github.com/repos/zeromq/netmq/issues/481","id":191920019,"user":{"login":"somdoron","id":2715638,"avatar_url":"https://avatars.githubusercontent.com/u/2715638?v=3","gravatar_id":"","url":"https://api.github.com/users/somdoron","html_url":"https://github.com/somdoron","followers_url":"https://api.github.com/users/somdoron/followers","following_url":"https://api.github.com/users/somdoron/following{/other_user}","gists_url":"https://api.github.com/users/somdoron/gists{/gist_id}","starred_url":"https://api.github.com/users/somdoron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/somdoron/subscriptions","organizations_url":"https://api.github.com/users/somdoron/orgs","repos_url":"https://api.github.com/users/somdoron/repos","events_url":"https://api.github.com/users/somdoron/events{/privacy}","received_events_url":"https://api.github.com/users/somdoron/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T19:13:15Z","updated_at":"2016-03-03T19:13:15Z","body":"only if highwatermark is reached you will loose messages.\r\n\r\nRegarding the exception, which exception do you get? does it happen on subscriber or publisher?"}}