{"action":"created","issue":{"url":"https://api.github.com/repos/zachary-D/zlib/issues/46","repository_url":"https://api.github.com/repos/zachary-D/zlib","labels_url":"https://api.github.com/repos/zachary-D/zlib/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/zachary-D/zlib/issues/46/comments","events_url":"https://api.github.com/repos/zachary-D/zlib/issues/46/events","html_url":"https://github.com/zachary-D/zlib/issues/46","id":378053883,"node_id":"MDU6SXNzdWUzNzgwNTM4ODM=","number":46,"title":"Update the constructor/destructor for `network::socketXXX::initializeSocket` and `socketXXX::closeSocket()` to make sure `WSAStartup()` and `WSACleanup()` aren't called to soon/multiple times","user":{"login":"zachary-D","id":16283501,"node_id":"MDQ6VXNlcjE2MjgzNTAx","avatar_url":"https://avatars1.githubusercontent.com/u/16283501?v=4","gravatar_id":"","url":"https://api.github.com/users/zachary-D","html_url":"https://github.com/zachary-D","followers_url":"https://api.github.com/users/zachary-D/followers","following_url":"https://api.github.com/users/zachary-D/following{/other_user}","gists_url":"https://api.github.com/users/zachary-D/gists{/gist_id}","starred_url":"https://api.github.com/users/zachary-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachary-D/subscriptions","organizations_url":"https://api.github.com/users/zachary-D/orgs","repos_url":"https://api.github.com/users/zachary-D/repos","events_url":"https://api.github.com/users/zachary-D/events{/privacy}","received_events_url":"https://api.github.com/users/zachary-D/received_events","type":"User","site_admin":false},"labels":[{"id":772591074,"node_id":"MDU6TGFiZWw3NzI1OTEwNzQ=","url":"https://api.github.com/repos/zachary-D/zlib/labels/bug","name":"bug","color":"ee0701","default":true},{"id":1077247533,"node_id":"MDU6TGFiZWwxMDc3MjQ3NTMz","url":"https://api.github.com/repos/zachary-D/zlib/labels/module:%20network","name":"module: network","color":"fbca04","default":false},{"id":775081158,"node_id":"MDU6TGFiZWw3NzUwODExNTg=","url":"https://api.github.com/repos/zachary-D/zlib/labels/todo","name":"todo","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-06T22:06:56Z","updated_at":"2018-11-06T22:15:09Z","closed_at":null,"author_association":"OWNER","body":"Currently `WSAStartup()` will be called every time a socket is instantiated, and `WSACleanup()` is called in `socketXXX::close()` (called in the destructor).  Extra care needs to be taken to make sure `WSAStartup is not called multiple times in a row (without `WSACleanup()` being called), and to make sure that `WSACleanup()` is not called while other sockets exist.\r\n\r\nThe solution to this is probably a static int existing in every class to count the number of socket instances that exist, and only call `WSAStartup()` when it is 0, and only call `WSACleanup()` when it is 1.  (The constructors/destructors for the socket classes would incriment/deincriment this as necessary)."},"comment":{"url":"https://api.github.com/repos/zachary-D/zlib/issues/comments/436428629","html_url":"https://github.com/zachary-D/zlib/issues/46#issuecomment-436428629","issue_url":"https://api.github.com/repos/zachary-D/zlib/issues/46","id":436428629,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjQyODYyOQ==","user":{"login":"zachary-D","id":16283501,"node_id":"MDQ6VXNlcjE2MjgzNTAx","avatar_url":"https://avatars1.githubusercontent.com/u/16283501?v=4","gravatar_id":"","url":"https://api.github.com/users/zachary-D","html_url":"https://github.com/zachary-D","followers_url":"https://api.github.com/users/zachary-D/followers","following_url":"https://api.github.com/users/zachary-D/following{/other_user}","gists_url":"https://api.github.com/users/zachary-D/gists{/gist_id}","starred_url":"https://api.github.com/users/zachary-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachary-D/subscriptions","organizations_url":"https://api.github.com/users/zachary-D/orgs","repos_url":"https://api.github.com/users/zachary-D/repos","events_url":"https://api.github.com/users/zachary-D/events{/privacy}","received_events_url":"https://api.github.com/users/zachary-D/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T22:15:09Z","updated_at":"2018-11-06T22:15:09Z","author_association":"OWNER","body":"We will also need to track whether the 'socket shutdown' tasks are executed on an individual socket or not, to make sure we don't try to shutdown twice, calling deincrimenting the sockets counter more than once per socket (which could lead us to call `WSACleanup()` too soon)"}}
{"actor":{"display_login":"zachary-D"}}