[Python-ideas] PEP 3156: getting the socket or peer name from the transport

Steve Dower Steve.Dower at microsoft.com
Thu Jan 24 21:16:58 CET 2013


Antoine Pitrou wrote:
> On Thu, 24 Jan 2013 10:23:40 -0800
> Guido van Rossum <guido at python.org> wrote:
> > A) An API to return the underlying socket, if there is one. (In the
> > case of a stack of transports and protocols there may not be one, so
> > it may return None.) Downside is that it requires the transport to use
> > sockets -- if it were to use some native Windows API there might not
> > be a socket object even though there might be an IP connection with
> > easily-accessible address and peer.
> 
> I don't understand why you say Windows doesn't use sockets for IP
> connections. AFAIK, sockets are the *only* way to do networking with the
> Windows API. See e.g. WSARecv, which supports synchronous and
> asynchronous operation:
> http://msdn.microsoft.com/en-
> us/library/windows/desktop/ms741688%28v=vs.85%29.aspx

There's also a whole selection of "Internet" APIs that could be used http://msdn.microsoft.com/en-us/library/hh309468.aspx and plenty (probably too many) other high level APIs. There's no expectation that every application has to deal solely in sockets. 

Cheers,
Steve





More information about the Python-ideas mailing list