[issue27392] Add a server_side keyword parameter to create_connection

2016-11-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3e6570231c80 by Yury Selivanov in branch '3.5': Issue #27392: Document loop.connect_accepted_socket() https://hg.python.org/cpython/rev/3e6570231c80 New changeset 6811df9e9797 by Yury Selivanov in branch '3.6': Merge 3.5 (issue #27392)

[issue27392] Add a server_side keyword parameter to create_connection

2016-10-06 Thread Yury Selivanov
Yury Selivanov added the comment: AFAICT this issue was resolved in https://github.com/python/asyncio/pull/378. Closing this one. Thanks, Jim! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Yury Selivanov
Yury Selivanov added the comment: > WRT boolean for SSL, I think it's very common for clients to verify server > certificates, but relatively uncommon for servers to require client > certificates. The impression I have from reading docs and stack overflow > posts that the most common use

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Jim Fulton
Jim Fulton added the comment: +1 restricting uvloop to AF_INET or AF_UNIX and SOCK_STREAM, at least until someone requests something else. -- ___ Python tracker

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Jim Fulton
Jim Fulton added the comment: WRT boolean for SSL, I think it's very common for clients to verify server certificates, but relatively uncommon for servers to require client certificates. The impression I have from reading docs and stack overflow posts that the most common use case for the

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Guido van Rossum
Guido van Rossum added the comment: I think it's okay if uvloop only handles those socket types. But if asyncio may be able to handle other types we shouldn't reject them just because we haven't heard about them. (E.g. IIRC someone was using Bluetooth sockets.) --

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Yury Selivanov
Yury Selivanov added the comment: > What would happen if some other socket type was passed? Would anything go wrong, assuming it's a socket type that understands connections? (I think checking for SOCK_STREAM is more important maybe). In uvloop I have to create different libuv handles for

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, I see. create_connection(..., ssl=True) creates a default SSLContext, but create_server(..., ssl=True) is invalid, it requires ssl=SSLContext(...). I like the latter for connect_accepted_socket(). I think Jim will happily comply. What would happen if some

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Yury Selivanov
Yury Selivanov added the comment: Also I think we should add a check, that the passed socket is AF_UNIX or AF_INET(6) -- ___ Python tracker ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Yury Selivanov
Yury Selivanov added the comment: Hm, I'm working on adding connect_accepted_socket to the uvloop. There is one difference between connect_accepted_socket and create_server/create_unix_server: the latter APIs forbid to pass boolean `ssl` argument, they require `ssl` to be an instance of

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Yury Selivanov
Yury Selivanov added the comment: > Did the patch not get merged?? connect_accepted_socket was merged. The docs patch is still pending (nothing wrong with it, I just need to commit it) -- ___ Python tracker

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Jim Fulton
Jim Fulton added the comment: idk if the patch got merged. I just added the last comment for informational purposes. :) Perhaps this issue can be closed. -- ___ Python tracker

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Guido van Rossum
Guido van Rossum added the comment: Did the patch not get merged?? On Sun, Aug 7, 2016 at 11:32 AM, Jim Fulton wrote: > > Jim Fulton added the comment: > > FTR another use case for this. :) > > We have a ZEO applications where individual database users authenticate >

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-07 Thread Jim Fulton
Jim Fulton added the comment: FTR another use case for this. :) We have a ZEO applications where individual database users authenticate via self-signed certs. The server's SSL connection has to have this collection of certs. User CRUD operations can add and remove certs to authenticate

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-19 Thread Yury Selivanov
Yury Selivanov added the comment: Jim, the patch lgtm. Will merge it soon. -- assignee: -> yselivanov ___ Python tracker ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-18 Thread Jim Fulton
Jim Fulton added the comment: Does the draft doc change look OK? -- ___ Python tracker ___ ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-14 Thread Jim Fulton
Jim Fulton added the comment: Here's a daft doc update. -- keywords: +patch Added file: http://bugs.python.org/file43718/connect_accepted_socket-doc.patch ___ Python tracker

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-12 Thread Yury Selivanov
Yury Selivanov added the comment: Let's keep this issue open until we have the docs updated. -- ___ Python tracker ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3e44c449433a by Yury Selivanov in branch '3.5': Issue #27392: Add loop.connect_accepted_socket(). https://hg.python.org/cpython/rev/3e44c449433a New changeset 2f0716009132 by Yury Selivanov in branch 'default': Merge 3.5 (issue #27392)

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-11 Thread Guido van Rossum
Guido van Rossum added the comment: Sounds Good To Me. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-11 Thread Yury Selivanov
Yury Selivanov added the comment: > How about we use connect_socket() or a variant on that name? That feels > similar to connect_{read,write}_pipe(), which also take a protocol_factory > and an already-opened I/O object. I like the idea to use "connect_" prefix here. How about simple

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-10 Thread Guido van Rossum
Guido van Rossum added the comment: How about we use connect_socket() or a variant on that name? That feels similar to connect_{read,write}_pipe(), which also take a protocol_factory and an already-opened I/O object. If it's only for server-side sockets I'd call it

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: Hold on. It's weekend. I will review this when I am near a laptop again. --Guido (mobile) -- ___ Python tracker ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton
Jim Fulton added the comment: > Why can't `wrap_socket` be used for wrapping client sockets? TOOWTDI and create_connection. I suppose we could remove (unadvertise) this functionality from create_connection. Then we'd have code bloat because backward compatibility. --

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Yury Selivanov
Yury Selivanov added the comment: > wrap_socket implies that it's for wrapping client or server sockets, but it's > not. It's only for handling server sockets. Also, I prefer a name that > reflects goal, not mechanism. > I think the name should be discussed over here: >

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton
Jim Fulton added the comment: We need an executive (Guido) decision on the name of the new API. Yury wants wrap_socket. I don't like wrap_socket because: - It implies that it's for wrapping client and server sockets. (It shouldn't be for wrapping client sockets because TOOWTDI and

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: I like the new method better. Submit away! --Guido (mobile) -- ___ Python tracker ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton
Jim Fulton added the comment: I'd still like to find a way to handle already accepted server sockets. Can we decide on either: - a server_side flag to create_connection or - A new interface for handling an already accepted socket? I would call this handle_connection, but I'll take any name.

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: :) I'm not a fan of monkey patching code in production, unless the code I'm monkey patching is code I control. (And since releasing code now is a lot easier than it used to be, I have much less occasion to monkey-patch code I control.) (I'm a big fan of and am

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Yury Selivanov
Yury Selivanov added the comment: > Rather tham monkey-patching, in general I recommend just copying some code from the asyncio library and calling that. In this case you'd be copying a tiny bit of code from create_connection(). You'd still be calling an internal API, _make_ssl_transport(), but

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Guido van Rossum
Guido van Rossum added the comment: Rather tham monkey-patching, in general I recommend just copying some code from the asyncio library and calling that. In this case you'd be copying a tiny bit of code from create_connection(). You'd still be calling an internal API, _make_ssl_transport(), but

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: With SSL, the protocol is a little different clients and servers, although that may just be in the handshake. I'm no SSL expert by any means. When you call wrap_socket on an SSLContext, you can pass server_side, which defaults to False. If you get this wrong,

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Guido van Rossum
Guido van Rossum added the comment: Hm. The docs in PEP 3156 do mention that create_connection() is for clients (though it weakens this with "typically"): https://www.python.org/dev/peps/pep-3156/#internet-connections I always think of TCP connections (which is what create_connection() is

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Guido van Rossum
Changes by Guido van Rossum : -- Removed message: http://bugs.python.org/msg269529 ___ Python tracker ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Guido van Rossum
Changes by Guido van Rossum : -- Removed message: http://bugs.python.org/msg269525 ___ Python tracker ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: Sorry, ignore my last message -- ___ Python tracker ___ ___ Python-bugs-list

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: See: https://bugs.launchpad.net/zodb/+bug/135108/comments/9 Sorry, I should have sent that link sooner. In my flailing to come up with a simple case, I forgot the importance of that setting. -- ___ Python tracker

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: >> Yury, I'm curious what you think the socket argument to create_connection is >> about. > > :) The current intended purpose of create_connection is to create a client > connection. You're proposing to add a new argument -- server_side -- which I > think will

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury, I'm curious what you think the socket argument to create_connection is > about. :) The current intended purpose of create_connection is to create a client connection. You're proposing to add a new argument -- server_side -- which I think will

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: BTW, a problem with this proposal that I realized after submitting it is that it changes an API that has multiple implementations, including implementations outside of the Python codebase. Arguably, this would require a PEP, at which point the change is

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: Yury, I'm curious what you think the socket argument to create_connection is about. -- ___ Python tracker ___

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: I agree that if create_server (or asyncio.Server) is buggy, it should be fixed! However, IMO, it's useful to be able to accept a connection outside of an asyncio event loop and then hand the loop the connected socket. --

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: Guido, IMO, there's value in having the ability to accept connections independently of handling them. It wasn't clear to me from reading the documentation that create_connection is only meant for making client connections, especially given that it can take an

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-29 Thread Jim Fulton
Jim Fulton added the comment: Tests are also unstable with uvloop. (Although uvloop doesn't have http://bugs.python.org/issue27386 at least.) I was eventually able to wrestle the test into submission using asyncio.Server. I suspect that some of this had to do with issues closing connections

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-26 Thread Guido van Rossum
Guido van Rossum added the comment: I'm confused. create_connection() is meant for creating client connection, so I don't think a server_side flag makes sense. (There are lower-level internal APIs that do take a server_side flag, but create_connection() is just one caller for these.) If

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-26 Thread Yury Selivanov
Yury Selivanov added the comment: > On Jun 26, 2016, at 12:05 PM, Jim Fulton wrote: > > I've switched my code to use create_server, but this has led to stability > problems. BTW, did you try to run ZEO tests on uvloop? I'm just curious if stability is somehow related

[issue27392] Add a server_side keyword parameter to create_connection

2016-06-26 Thread Jim Fulton
New submission from Jim Fulton: The event loop create_connection method can take a socket to create a connection on an existing socket, including sockets obtained via an external listener. If an SSL context is provided, however, it assumes it's creating a client connection, making it