{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/netmq/issues/221","labels_url":"https://api.github.com/repos/zeromq/netmq/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/netmq/issues/221/comments","events_url":"https://api.github.com/repos/zeromq/netmq/issues/221/events","html_url":"https://github.com/zeromq/netmq/issues/221","id":56234448,"number":221,"title":"ArgumentOutOfRangeException in publisher.Send(msg)","user":{"login":"thomastvedt","id":4746639,"avatar_url":"https://avatars.githubusercontent.com/u/4746639?v=3","gravatar_id":"","url":"https://api.github.com/users/thomastvedt","html_url":"https://github.com/thomastvedt","followers_url":"https://api.github.com/users/thomastvedt/followers","following_url":"https://api.github.com/users/thomastvedt/following{/other_user}","gists_url":"https://api.github.com/users/thomastvedt/gists{/gist_id}","starred_url":"https://api.github.com/users/thomastvedt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomastvedt/subscriptions","organizations_url":"https://api.github.com/users/thomastvedt/orgs","repos_url":"https://api.github.com/users/thomastvedt/repos","events_url":"https://api.github.com/users/thomastvedt/events{/privacy}","received_events_url":"https://api.github.com/users/thomastvedt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-02T13:05:39Z","updated_at":"2015-02-03T12:49:12Z","closed_at":null,"body":"I'm writing a Lync MSPL application which listens to sip-messages and uses a netmq publisher to send messages to one or more subscribers. It works ok, but sometimes (possibly under heavy load?) I get the following errormessage:\r\n\r\n    System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.\r\n    Parameter name: index\r\n    at System.Collections.Generic.List'1.get_Item(Int32 index)\r\n    at NetMQ.zmq.Dist.Distribute(Msg& msg, SendReceiveOptions flags)\r\n    at NetMW.zmq.XPub.XSend(Msg& msg, SendReceiveOptions flags)\r\n    at NetMQ.zmq.SocketBase.Send(Msg& msg, SendReceiveOptions flags)\r\n    at NetMQ.OutgoingSocketExtensions.Send(IOutgoingSocket socket, String message, Encoding encoding, SendReceiveOptions options)\r\n    at Myapp.Filter.OnResponse(Object sender, NotificationReceivedEventArgs e)\r\n\r\n\r\nparts of my publisher code:\r\n\r\n    class Filter : IDisposable\r\n    {\r\n      public Filter()\r\n      {\r\n        _netMqContext = NetMQContext.Create();\r\n        _publisherSocket = _netMqContext.CreatePublisherSocket();\r\n        _address = \"tcp://*:7878\";\r\n        _publisher.Bind(_address);\r\n      }\r\n\r\n     public void OnResponse(object sender, NotificationReceivedEventArgs e)\r\n     {\r\n        _publisherSocket.Send(message, encoding)\r\n     }\r\n\r\n\tpublic void Dispose()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif (_publisher != null)\r\n\t\t\t{\r\n\t\t\t\t_publisher.Unbind(_address);\r\n\t\t\t\t_publisher.Dispose();\r\n\t\t\t}\r\n\t\t\tif (_netMqContext != null)\r\n\t\t\t{\r\n\t\t\t\t_netMqContext.Dispose();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception exception)\r\n\t\t{\r\n\t\t\tLog.Error(exception);\r\n\t\t}\r\n\t}\r\n   }\r\n\r\nI'm sure that I'm doing something wrong, can you see what is causing the errormessage? "},"comment":{"url":"https://api.github.com/repos/zeromq/netmq/issues/comments/72644697","html_url":"https://github.com/zeromq/netmq/issues/221#issuecomment-72644697","issue_url":"https://api.github.com/repos/zeromq/netmq/issues/221","id":72644697,"user":{"login":"leverate-somech","id":5821195,"avatar_url":"https://avatars.githubusercontent.com/u/5821195?v=3","gravatar_id":"","url":"https://api.github.com/users/leverate-somech","html_url":"https://github.com/leverate-somech","followers_url":"https://api.github.com/users/leverate-somech/followers","following_url":"https://api.github.com/users/leverate-somech/following{/other_user}","gists_url":"https://api.github.com/users/leverate-somech/gists{/gist_id}","starred_url":"https://api.github.com/users/leverate-somech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leverate-somech/subscriptions","organizations_url":"https://api.github.com/users/leverate-somech/orgs","repos_url":"https://api.github.com/users/leverate-somech/repos","events_url":"https://api.github.com/users/leverate-somech/events{/privacy}","received_events_url":"https://api.github.com/users/leverate-somech/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T12:49:12Z","updated_at":"2015-02-03T12:49:12Z","body":"@thomastvedt can you test if this also happen on version v3.3.0.12?"}}