{"action":"created","issue":{"url":"https://api.github.com/repos/google/gopacket/issues/143","labels_url":"https://api.github.com/repos/google/gopacket/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/google/gopacket/issues/143/comments","events_url":"https://api.github.com/repos/google/gopacket/issues/143/events","html_url":"https://github.com/google/gopacket/issues/143","id":109271833,"number":143,"title":"Variable PacketSource buffer size","user":{"login":"LrsK","id":827702,"avatar_url":"https://avatars.githubusercontent.com/u/827702?v=3","gravatar_id":"","url":"https://api.github.com/users/LrsK","html_url":"https://github.com/LrsK","followers_url":"https://api.github.com/users/LrsK/followers","following_url":"https://api.github.com/users/LrsK/following{/other_user}","gists_url":"https://api.github.com/users/LrsK/gists{/gist_id}","starred_url":"https://api.github.com/users/LrsK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LrsK/subscriptions","organizations_url":"https://api.github.com/users/LrsK/orgs","repos_url":"https://api.github.com/users/LrsK/repos","events_url":"https://api.github.com/users/LrsK/events{/privacy}","received_events_url":"https://api.github.com/users/LrsK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-01T10:21:52Z","updated_at":"2015-10-01T15:27:03Z","closed_at":null,"body":"It would be convenient if the buffer size of the chennel of Packets was adjustable, so that it would look like this:\r\n\r\n```\r\nfunc (p *PacketSource) Packets(chanSize uint) chan Packet {\r\n\tif p.c == nil {\r\n\t\tp.c = make(chan Packet, chanSize)\r\n\t\tgo p.packetsToChannel()\r\n\t}\r\n\treturn p.c\r\n}\r\n```\r\n\r\nFor some applications, the buffer will need to be quite large to accomodate large amoutns of traffic."},"comment":{"url":"https://api.github.com/repos/google/gopacket/issues/comments/144762462","html_url":"https://github.com/google/gopacket/issues/143#issuecomment-144762462","issue_url":"https://api.github.com/repos/google/gopacket/issues/143","id":144762462,"user":{"login":"gconnell","id":1211830,"avatar_url":"https://avatars.githubusercontent.com/u/1211830?v=3","gravatar_id":"","url":"https://api.github.com/users/gconnell","html_url":"https://github.com/gconnell","followers_url":"https://api.github.com/users/gconnell/followers","following_url":"https://api.github.com/users/gconnell/following{/other_user}","gists_url":"https://api.github.com/users/gconnell/gists{/gist_id}","starred_url":"https://api.github.com/users/gconnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gconnell/subscriptions","organizations_url":"https://api.github.com/users/gconnell/orgs","repos_url":"https://api.github.com/users/gconnell/repos","events_url":"https://api.github.com/users/gconnell/events{/privacy}","received_events_url":"https://api.github.com/users/gconnell/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T15:27:03Z","updated_at":"2015-10-01T15:27:03Z","body":"Could this be handled with:\n\nmyChan := make(chan Packet, N)\ngo func() {\n  for p := range psource.Packets() {\n    myChan <- p\n  }\n}()\n\nOn Thu, Oct 1, 2015 at 4:21 AM, LrsK <notifications@github.com> wrote:\n\n> It would be convenient if the buffer size of the chennel of Packets was\n> adjustable, so that it would look like this:\n>\n> func (p *PacketSource) Packets(chanSize uint) chan Packet {\n>     if p.c == nil {\n>         p.c = make(chan Packet, chanSize)\n>         go p.packetsToChannel()\n>     }\n>     return p.c\n> }\n>\n> For some applications, the buffer will need to be quite large to\n> accomodate large amoutns of traffic.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/google/gopacket/issues/143>.\n>\n"}}