[issue23630] support multiple hosts in create_server/start_server

2015-09-22 Thread Yann Sionneau
Yann Sionneau added the comment: Thanks a lot Victor for your numerous reviews and your help on this! Also thanks for all other who commented. -- ___ Python tracker

[issue23630] support multiple hosts in create_server/start_server

2015-09-21 Thread STINNER Victor
STINNER Victor added the comment: I pushed the change to Python 3.4, 3.5, 3.6 and asyncio at Github. Thanks Yann for your nice enhancement of asyncio! It put your name in CPython "acks" and asyncio author list. I modified the patch a little bit (3 lines), how the hosts variable was

[issue23630] support multiple hosts in create_server/start_server

2015-09-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 682623e3e793 by Victor Stinner in branch '3.4': Issue #23630, asyncio: host parameter of loop.create_server() can now be a https://hg.python.org/cpython/rev/682623e3e793 -- nosy: +python-dev ___ Python

[issue23630] support multiple hosts in create_server/start_server

2015-09-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 42e7334e0e4c by Victor Stinner in branch '3.4': Issue #23630: Fix test_asyncio on Windows https://hg.python.org/cpython/rev/42e7334e0e4c New changeset 840942a3f6aa by Victor Stinner in branch '3.5': Merge 3.4 (Issue #23630, fix test_asyncio)

[issue23630] support multiple hosts in create_server/start_server

2015-09-04 Thread Yann Sionneau
Yann Sionneau added the comment: A new (and hopefully last?) version of the patch, thanks again for the review Victor! -- Added file: http://bugs.python.org/file40356/multibind7.patch ___ Python tracker

[issue23630] support multiple hosts in create_server/start_server

2015-09-04 Thread STINNER Victor
STINNER Victor added the comment: Good. I have less comments, it's getting better at each iteration ;) -- ___ Python tracker ___

[issue23630] support multiple hosts in create_server/start_server

2015-09-04 Thread Yann Sionneau
Yann Sionneau added the comment: Yet another version of the patch according to the last review. -- Added file: http://bugs.python.org/file40366/multibind8.patch ___ Python tracker

[issue23630] support multiple hosts in create_server/start_server

2015-09-03 Thread Yann Sionneau
Yann Sionneau added the comment: Here is a new patch without any dependency on netifaces. Thanks Victor for the great deal of help for all the mock() stuff! -- Added file: http://bugs.python.org/file40342/multibind6.patch ___ Python tracker

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread Yury Selivanov
Yury Selivanov added the comment: Yann, I'll commit this as soon as 3.5.0 and 3.4.4 are out. -- ___ Python tracker ___

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread STINNER Victor
STINNER Victor added the comment: > The only remaining question is is it OK that we can specify more than one > host but only one port? Guido, Victor? I can be convenient to have a single Server object with *all* listening sockets. So I like the idea of supporting multiple ports. It's very

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread STINNER Victor
STINNER Victor added the comment: Since the consensus on python-dev looks more to keep the provisional API for asyncion in Python 3.5, I propose to even modify Python 3.4 to not add too many "if python >= 3.5..." checks in asyncio source code. If you really prefer to keep Python 3.4

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread Yury Selivanov
Yury Selivanov added the comment: > I can be convenient to have a single Server object with *all* listening > sockets. So I like the idea of supporting multiple ports. It's very cheap to > support it. I like the idea too, but I'm not sure how to redesign the function's signature to accept

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread Yann Sionneau
Yann Sionneau added the comment: About the function's signature to accept multiple hosts & ports, we could - accept host and port arguments being sequences and then we bind to all host:port combinations. Like if len(host) == N and len(port) == M, we bind to N*M sockets. or - accept host

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread STINNER Victor
STINNER Victor added the comment: > Let's not extend the API with support for multiple ports. Nobody has asked > for it, and clearly the API design is not so simple. Ok. Anyway, the user of the API call call create_server() multiple times, even with the current code. So it's fine. --

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread STINNER Victor
STINNER Victor added the comment: "So I like the idea of supporting multiple ports. It's very cheap to support it." Oh, I had an example in my head: listening on tcp/80 for HTTP and tcp/443 for HTTPS... but it doesn't work. The problem is that the proposed API doesn't allow to specify a

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread Guido van Rossum
Guido van Rossum added the comment: Let's not extend the API with support for multiple ports. Nobody has asked for it, and clearly the API design is not so simple. -- ___ Python tracker

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread Yury Selivanov
Yury Selivanov added the comment: > - accept host and port arguments being sequences and then we bind to all > host:port combinations. Like if len(host) == N and len(port) == M, we bind to > N*M sockets. I can't think of a real life example for this. But if you need that, you can always

[issue23630] support multiple hosts in create_server/start_server

2015-08-28 Thread Yann Sionneau
Yann Sionneau added the comment: A new patch with capitalization of first words of sentences + splitting lines which are too long (more PEP8 friendly). -- Added file: http://bugs.python.org/file40280/multibind4.patch ___ Python tracker

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yann Sionneau
Yann Sionneau added the comment: All right, here is the new patch then. -- Added file: http://bugs.python.org/file40275/multibind3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yury Selivanov
Yury Selivanov added the comment: How am I supposed to handle the method being called with a Mock'ed getaddrinfo? Why would you call it that way? Are regular asyncio users going to mock it in their production/test code? If the only case for using mocks there are asyncio unittests -- just

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks! The only remaining question is is it OK that we can specify more than one host but only one port? Guido, Victor? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, I think this is fine. I think the use case for multiple hosts is very different than that for multiple ports, so I see no reason to link the two features, and multiple ports hasn't been requested. The patch has a long line and the new docstring looks

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yann Sionneau
Yann Sionneau added the comment: All right, thanks. I fixed everything but the thing about getaddrinfo being Mock'ed. How am I supposed to handle the method being called with a Mock'ed getaddrinfo? -- ___ Python tracker rep...@bugs.python.org

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Guido van Rossum
Guido van Rossum added the comment: The traditional solution is to rewrite the sentence so the name is not the first word. :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630 ___

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yury Selivanov
Yury Selivanov added the comment: Yeah, I think this is fine. I think the use case for multiple hosts is very different than that for multiple ports, so I see no reason to link the two features, and multiple ports hasn't been requested. OK! The patch has a long line and the new docstring

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Guido van Rossum
Guido van Rossum added the comment: Also, I guess you'll need a branch that tracks what's going into 3.6. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630 ___

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yann Sionneau
Yann Sionneau added the comment: About the missing capitalization, I omitted it because it's the argument's name. But I can resubmit with it being capitalized. I forgot to run flake8, sorry! -- ___ Python tracker rep...@bugs.python.org

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Guido van Rossum
Guido van Rossum added the comment: It can't go into 3.5.1 (a bugfix release) because it is a new feature (however small), and asyncio is not provisional in 3.5 (only in 3.4). -- ___ Python tracker rep...@bugs.python.org

[issue23630] support multiple hosts in create_server/start_server

2015-08-26 Thread Yury Selivanov
Yury Selivanov added the comment: Left some feedback in the code review. I have a question about the api: so we allow to pass a set of hosts to create_server, but why do we have only a single port? -- ___ Python tracker rep...@bugs.python.org

[issue23630] support multiple hosts in create_server/start_server

2015-08-26 Thread Yury Selivanov
Yury Selivanov added the comment: Here is a new patch, with modifications according to your review Victor. Could you please generate the patch with 'hg diff', so that code review works with it. -- ___ Python tracker rep...@bugs.python.org

[issue23630] support multiple hosts in create_server/start_server

2015-08-26 Thread Yann Sionneau
Yann Sionneau added the comment: Ah yes, sorry about that. Here is a new patch. However, I worked on these sources: https://github.com/python/asyncio which now I understand was not the correct repository, but I added a tests_require=netifaces in the setup.py, where can I add this dependency in

[issue23630] support multiple hosts in create_server/start_server

2015-08-26 Thread Yann Sionneau
Yann Sionneau added the comment: Here is a new patch, with modifications according to your review Victor. Thanks! -- Added file: http://bugs.python.org/file40270/multibind2.patch ___ Python tracker rep...@bugs.python.org

[issue23630] support multiple hosts in create_server/start_server

2015-08-26 Thread Yann Sionneau
Changes by Yann Sionneau y...@m-labs.hk: Removed file: http://bugs.python.org/file40270/multibind2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630 ___

[issue23630] support multiple hosts in create_server/start_server

2015-07-01 Thread STINNER Victor
STINNER Victor added the comment: I reviewed multibind.patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630 ___ ___ Python-bugs-list

[issue23630] support multiple hosts in create_server/start_server

2015-04-21 Thread Yann Sionneau
Yann Sionneau added the comment: ping ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23630] support multiple hosts in create_server/start_server

2015-03-20 Thread Yann Sionneau
Yann Sionneau added the comment: Please let me know if you need anything for this patch to be integrated. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630 ___

[issue23630] support multiple hosts in create_server/start_server

2015-03-12 Thread Guido van Rossum
Guido van Rossum added the comment: Could use a test. Hopefully Victor can do a thorough review. On Tue, Mar 10, 2015 at 12:20 PM, Sebastien Bourdeauducq rep...@bugs.python.org wrote: Sebastien Bourdeauducq added the comment: See attached. -- keywords: +patch Added file:

[issue23630] support multiple hosts in create_server/start_server

2015-03-12 Thread Sebastien Bourdeauducq
New submission from Sebastien Bourdeauducq: I would like to be able to bind asyncio TCP servers to an arbitrary list of hosts, not just either one host or all interfaces. I propose that the host parameter of create_server and start_server can be a list of strings that describes each host.

[issue23630] support multiple hosts in create_server/start_server

2015-03-11 Thread Yann Sionneau
Yann Sionneau added the comment: Here is a test related to Sebastien's patch. -- nosy: +ysionneau Added file: http://bugs.python.org/file38441/asyncio_multibind_test.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630

[issue23630] support multiple hosts in create_server/start_server

2015-03-11 Thread STINNER Victor
STINNER Victor added the comment: Combine patch written for CPython tree, so we get the review button. -- Added file: http://bugs.python.org/file38442/multibind.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630

[issue23630] support multiple hosts in create_server/start_server

2015-03-10 Thread Guido van Rossum
Guido van Rossum added the comment: This makes some sense, but it's easy to work around -- just call create_server() multiple times, once for each host. Why does that not work for you? -- ___ Python tracker rep...@bugs.python.org

[issue23630] support multiple hosts in create_server/start_server

2015-03-10 Thread Sebastien Bourdeauducq
Sebastien Bourdeauducq added the comment: That could work, but I would have to manually resolve and filter the lists of hostnames so that the program does not attempt to bind the same address twice - something that is better implemented in create_server, which already does the hostname

[issue23630] support multiple hosts in create_server/start_server

2015-03-10 Thread Guido van Rossum
Guido van Rossum added the comment: So it sounds like you already have a patch in mind... Can you work on it and upload it? (It's open source -- you get to make it yourself. :-) -- ___ Python tracker rep...@bugs.python.org

[issue23630] support multiple hosts in create_server/start_server

2015-03-10 Thread Sebastien Bourdeauducq
Sebastien Bourdeauducq added the comment: See attached. -- keywords: +patch Added file: http://bugs.python.org/file38428/asyncio_multibind.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630