{"action":"created","comment":{"url":"https://api.github.com/repos/Pylons/waitress/pulls/comments/66717113","id":66717113,"diff_hunk":"@@ -42,27 +42,95 @@ def create_server(application,\n             'to return a WSGI app within your application.'\n             )\n     adj = Adjustments(**kw)\n+\n+    if map is None: # pragma: nocover\n+        map = {}\n+\n+    dispatcher = _dispatcher\n+    if dispatcher is None:\n+        dispatcher = ThreadedTaskDispatcher()\n+        dispatcher.set_thread_count(adj.threads)\n+\n     if adj.unix_socket and hasattr(socket, 'AF_UNIX'):\n-        cls = UnixWSGIServer\n-    else:\n-        cls = TcpWSGIServer\n-    return cls(application, map, _start, _sock, _dispatcher, adj)\n+        sockinfo = (socket.AF_UNIX, socket.SOCK_STREAM, None, None)\n+        return UnixWSGIServer(\n+            application,\n+            map,\n+            _start,\n+            _sock,\n+            dispatcher=dispatcher,\n+            adj=adj,\n+            sockinfo=sockinfo)\n+\n+    effective_listen = []\n+    last_serv = None\n+    for sockinfo in adj.listen:\n+        last_serv = TcpWSGIServer(\n+            application,\n+            map,\n+            _start,\n+            _sock,\n+            dispatcher=dispatcher,\n+            adj=adj,\n+            sockinfo=sockinfo)\n+        effective_listen.append((last_serv.effective_host, last_serv.effective_port))\n+\n+    # We are running a single server, so we can just return it...\n+    if len(adj.listen) == 1:\n+        return last_serv\n+\n+    return BaseServer(map, adj, effective_listen, dispatcher)\n+\n+class BaseServer(object):","path":"waitress/server.py","position":47,"original_position":47,"commit_id":"34cb81590c2f1f713e959ddce64fbd4255d431f5","original_commit_id":"34cb81590c2f1f713e959ddce64fbd4255d431f5","user":{"login":"mcdonc","id":125174,"avatar_url":"https://avatars.githubusercontent.com/u/125174?v=3","gravatar_id":"","url":"https://api.github.com/users/mcdonc","html_url":"https://github.com/mcdonc","followers_url":"https://api.github.com/users/mcdonc/followers","following_url":"https://api.github.com/users/mcdonc/following{/other_user}","gists_url":"https://api.github.com/users/mcdonc/gists{/gist_id}","starred_url":"https://api.github.com/users/mcdonc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcdonc/subscriptions","organizations_url":"https://api.github.com/users/mcdonc/orgs","repos_url":"https://api.github.com/users/mcdonc/repos","events_url":"https://api.github.com/users/mcdonc/events{/privacy}","received_events_url":"https://api.github.com/users/mcdonc/received_events","type":"User","site_admin":false},"body":"Another option would be to pass the various WSGI server instance objects into the multiserver class so it least appears that they aren't being constructed and then thrown away.  You'd still need to explain that they were jammed into the map, however, I guess.","created_at":"2016-06-12T06:51:39Z","updated_at":"2016-06-12T06:51:39Z","html_url":"https://github.com/Pylons/waitress/pull/128#discussion_r66717113","pull_request_url":"https://api.github.com/repos/Pylons/waitress/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/Pylons/waitress/pulls/comments/66717113"},"html":{"href":"https://github.com/Pylons/waitress/pull/128#discussion_r66717113"},"pull_request":{"href":"https://api.github.com/repos/Pylons/waitress/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/Pylons/waitress/pulls/128","id":72274077,"html_url":"https://github.com/Pylons/waitress/pull/128","diff_url":"https://github.com/Pylons/waitress/pull/128.diff","patch_url":"https://github.com/Pylons/waitress/pull/128.patch","issue_url":"https://api.github.com/repos/Pylons/waitress/issues/128","number":128,"state":"open","locked":false,"title":"Feature: multiple sockets","user":{"login":"bertjwregeer","id":649426,"avatar_url":"https://avatars.githubusercontent.com/u/649426?v=3","gravatar_id":"","url":"https://api.github.com/users/bertjwregeer","html_url":"https://github.com/bertjwregeer","followers_url":"https://api.github.com/users/bertjwregeer/followers","following_url":"https://api.github.com/users/bertjwregeer/following{/other_user}","gists_url":"https://api.github.com/users/bertjwregeer/gists{/gist_id}","starred_url":"https://api.github.com/users/bertjwregeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertjwregeer/subscriptions","organizations_url":"https://api.github.com/users/bertjwregeer/orgs","repos_url":"https://api.github.com/users/bertjwregeer/repos","events_url":"https://api.github.com/users/bertjwregeer/events{/privacy}","received_events_url":"https://api.github.com/users/bertjwregeer/received_events","type":"User","site_admin":false},"body":"This is a patch that allows waitress to listen on multiple sockets, thereby allowing waitress to support both IPv4 and IPv6.","created_at":"2016-06-02T00:37:15Z","updated_at":"2016-06-12T06:51:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb317e7d23e079938bc4737b37f3341f1d20c132","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Pylons/waitress/pulls/128/commits","review_comments_url":"https://api.github.com/repos/Pylons/waitress/pulls/128/comments","review_comment_url":"https://api.github.com/repos/Pylons/waitress/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Pylons/waitress/issues/128/comments","statuses_url":"https://api.github.com/repos/Pylons/waitress/statuses/34cb81590c2f1f713e959ddce64fbd4255d431f5","head":{"label":"Pylons:feature/multiple_sockets","ref":"feature/multiple_sockets","sha":"34cb81590c2f1f713e959ddce64fbd4255d431f5","user":{"login":"Pylons","id":452227,"avatar_url":"https://avatars.githubusercontent.com/u/452227?v=3","gravatar_id":"","url":"https://api.github.com/users/Pylons","html_url":"https://github.com/Pylons","followers_url":"https://api.github.com/users/Pylons/followers","following_url":"https://api.github.com/users/Pylons/following{/other_user}","gists_url":"https://api.github.com/users/Pylons/gists{/gist_id}","starred_url":"https://api.github.com/users/Pylons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pylons/subscriptions","organizations_url":"https://api.github.com/users/Pylons/orgs","repos_url":"https://api.github.com/users/Pylons/repos","events_url":"https://api.github.com/users/Pylons/events{/privacy}","received_events_url":"https://api.github.com/users/Pylons/received_events","type":"Organization","site_admin":false},"repo":{"id":2999982,"name":"waitress","full_name":"Pylons/waitress","owner":{"login":"Pylons","id":452227,"avatar_url":"https://avatars.githubusercontent.com/u/452227?v=3","gravatar_id":"","url":"https://api.github.com/users/Pylons","html_url":"https://github.com/Pylons","followers_url":"https://api.github.com/users/Pylons/followers","following_url":"https://api.github.com/users/Pylons/following{/other_user}","gists_url":"https://api.github.com/users/Pylons/gists{/gist_id}","starred_url":"https://api.github.com/users/Pylons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pylons/subscriptions","organizations_url":"https://api.github.com/users/Pylons/orgs","repos_url":"https://api.github.com/users/Pylons/repos","events_url":"https://api.github.com/users/Pylons/events{/privacy}","received_events_url":"https://api.github.com/users/Pylons/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Pylons/waitress","description":"WSGI server","fork":false,"url":"https://api.github.com/repos/Pylons/waitress","forks_url":"https://api.github.com/repos/Pylons/waitress/forks","keys_url":"https://api.github.com/repos/Pylons/waitress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Pylons/waitress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Pylons/waitress/teams","hooks_url":"https://api.github.com/repos/Pylons/waitress/hooks","issue_events_url":"https://api.github.com/repos/Pylons/waitress/issues/events{/number}","events_url":"https://api.github.com/repos/Pylons/waitress/events","assignees_url":"https://api.github.com/repos/Pylons/waitress/assignees{/user}","branches_url":"https://api.github.com/repos/Pylons/waitress/branches{/branch}","tags_url":"https://api.github.com/repos/Pylons/waitress/tags","blobs_url":"https://api.github.com/repos/Pylons/waitress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Pylons/waitress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Pylons/waitress/git/refs{/sha}","trees_url":"https://api.github.com/repos/Pylons/waitress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Pylons/waitress/statuses/{sha}","languages_url":"https://api.github.com/repos/Pylons/waitress/languages","stargazers_url":"https://api.github.com/repos/Pylons/waitress/stargazers","contributors_url":"https://api.github.com/repos/Pylons/waitress/contributors","subscribers_url":"https://api.github.com/repos/Pylons/waitress/subscribers","subscription_url":"https://api.github.com/repos/Pylons/waitress/subscription","commits_url":"https://api.github.com/repos/Pylons/waitress/commits{/sha}","git_commits_url":"https://api.github.com/repos/Pylons/waitress/git/commits{/sha}","comments_url":"https://api.github.com/repos/Pylons/waitress/comments{/number}","issue_comment_url":"https://api.github.com/repos/Pylons/waitress/issues/comments{/number}","contents_url":"https://api.github.com/repos/Pylons/waitress/contents/{+path}","compare_url":"https://api.github.com/repos/Pylons/waitress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Pylons/waitress/merges","archive_url":"https://api.github.com/repos/Pylons/waitress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Pylons/waitress/downloads","issues_url":"https://api.github.com/repos/Pylons/waitress/issues{/number}","pulls_url":"https://api.github.com/repos/Pylons/waitress/pulls{/number}","milestones_url":"https://api.github.com/repos/Pylons/waitress/milestones{/number}","notifications_url":"https://api.github.com/repos/Pylons/waitress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Pylons/waitress/labels{/name}","releases_url":"https://api.github.com/repos/Pylons/waitress/releases{/id}","deployments_url":"https://api.github.com/repos/Pylons/waitress/deployments","created_at":"2011-12-17T06:58:21Z","updated_at":"2016-06-10T19:25:26Z","pushed_at":"2016-06-12T02:34:15Z","git_url":"git://github.com/Pylons/waitress.git","ssh_url":"git@github.com:Pylons/waitress.git","clone_url":"https://github.com/Pylons/waitress.git","svn_url":"https://github.com/Pylons/waitress","homepage":"http://docs.pylonsproject.org/projects/waitress/en/latest/","size":1170,"stargazers_count":266,"watchers_count":266,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":28,"forks":57,"open_issues":28,"watchers":266,"default_branch":"master"}},"base":{"label":"Pylons:master","ref":"master","sha":"60be8767a1b35c5561becbaf47f93e26632779c9","user":{"login":"Pylons","id":452227,"avatar_url":"https://avatars.githubusercontent.com/u/452227?v=3","gravatar_id":"","url":"https://api.github.com/users/Pylons","html_url":"https://github.com/Pylons","followers_url":"https://api.github.com/users/Pylons/followers","following_url":"https://api.github.com/users/Pylons/following{/other_user}","gists_url":"https://api.github.com/users/Pylons/gists{/gist_id}","starred_url":"https://api.github.com/users/Pylons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pylons/subscriptions","organizations_url":"https://api.github.com/users/Pylons/orgs","repos_url":"https://api.github.com/users/Pylons/repos","events_url":"https://api.github.com/users/Pylons/events{/privacy}","received_events_url":"https://api.github.com/users/Pylons/received_events","type":"Organization","site_admin":false},"repo":{"id":2999982,"name":"waitress","full_name":"Pylons/waitress","owner":{"login":"Pylons","id":452227,"avatar_url":"https://avatars.githubusercontent.com/u/452227?v=3","gravatar_id":"","url":"https://api.github.com/users/Pylons","html_url":"https://github.com/Pylons","followers_url":"https://api.github.com/users/Pylons/followers","following_url":"https://api.github.com/users/Pylons/following{/other_user}","gists_url":"https://api.github.com/users/Pylons/gists{/gist_id}","starred_url":"https://api.github.com/users/Pylons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pylons/subscriptions","organizations_url":"https://api.github.com/users/Pylons/orgs","repos_url":"https://api.github.com/users/Pylons/repos","events_url":"https://api.github.com/users/Pylons/events{/privacy}","received_events_url":"https://api.github.com/users/Pylons/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Pylons/waitress","description":"WSGI server","fork":false,"url":"https://api.github.com/repos/Pylons/waitress","forks_url":"https://api.github.com/repos/Pylons/waitress/forks","keys_url":"https://api.github.com/repos/Pylons/waitress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Pylons/waitress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Pylons/waitress/teams","hooks_url":"https://api.github.com/repos/Pylons/waitress/hooks","issue_events_url":"https://api.github.com/repos/Pylons/waitress/issues/events{/number}","events_url":"https://api.github.com/repos/Pylons/waitress/events","assignees_url":"https://api.github.com/repos/Pylons/waitress/assignees{/user}","branches_url":"https://api.github.com/repos/Pylons/waitress/branches{/branch}","tags_url":"https://api.github.com/repos/Pylons/waitress/tags","blobs_url":"https://api.github.com/repos/Pylons/waitress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Pylons/waitress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Pylons/waitress/git/refs{/sha}","trees_url":"https://api.github.com/repos/Pylons/waitress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Pylons/waitress/statuses/{sha}","languages_url":"https://api.github.com/repos/Pylons/waitress/languages","stargazers_url":"https://api.github.com/repos/Pylons/waitress/stargazers","contributors_url":"https://api.github.com/repos/Pylons/waitress/contributors","subscribers_url":"https://api.github.com/repos/Pylons/waitress/subscribers","subscription_url":"https://api.github.com/repos/Pylons/waitress/subscription","commits_url":"https://api.github.com/repos/Pylons/waitress/commits{/sha}","git_commits_url":"https://api.github.com/repos/Pylons/waitress/git/commits{/sha}","comments_url":"https://api.github.com/repos/Pylons/waitress/comments{/number}","issue_comment_url":"https://api.github.com/repos/Pylons/waitress/issues/comments{/number}","contents_url":"https://api.github.com/repos/Pylons/waitress/contents/{+path}","compare_url":"https://api.github.com/repos/Pylons/waitress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Pylons/waitress/merges","archive_url":"https://api.github.com/repos/Pylons/waitress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Pylons/waitress/downloads","issues_url":"https://api.github.com/repos/Pylons/waitress/issues{/number}","pulls_url":"https://api.github.com/repos/Pylons/waitress/pulls{/number}","milestones_url":"https://api.github.com/repos/Pylons/waitress/milestones{/number}","notifications_url":"https://api.github.com/repos/Pylons/waitress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Pylons/waitress/labels{/name}","releases_url":"https://api.github.com/repos/Pylons/waitress/releases{/id}","deployments_url":"https://api.github.com/repos/Pylons/waitress/deployments","created_at":"2011-12-17T06:58:21Z","updated_at":"2016-06-10T19:25:26Z","pushed_at":"2016-06-12T02:34:15Z","git_url":"git://github.com/Pylons/waitress.git","ssh_url":"git@github.com:Pylons/waitress.git","clone_url":"https://github.com/Pylons/waitress.git","svn_url":"https://github.com/Pylons/waitress","homepage":"http://docs.pylonsproject.org/projects/waitress/en/latest/","size":1170,"stargazers_count":266,"watchers_count":266,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":28,"forks":57,"open_issues":28,"watchers":266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Pylons/waitress/pulls/128"},"html":{"href":"https://github.com/Pylons/waitress/pull/128"},"issue":{"href":"https://api.github.com/repos/Pylons/waitress/issues/128"},"comments":{"href":"https://api.github.com/repos/Pylons/waitress/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/Pylons/waitress/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/Pylons/waitress/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Pylons/waitress/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/Pylons/waitress/statuses/34cb81590c2f1f713e959ddce64fbd4255d431f5"}}}}
{"actor":{"display_login":"mcdonc"}}