> It appears that the easiest way to retrieve family/type/protocol > fields from socket objects is this: > def getsockinfo(sock): > s = `sock._sock` > sp = s[1:-1].split(",")[1:] > g = {} > d = {} > for i in sp: > exec i.strip() in g, d > return (d["family"], d["type"], d["protocol"]) > Wouldn't it be nice to have accessors for these fields? My > particular use-case is Windows-specific (IO completion port > proactor), so winsock API provides this, but I'd rather avoid that > crud. Sounds like a good idea. Upload your patches to SF! > Also, exporting getsockaddrarg in socketmodule.c CAPI would be > useful, although the only use I can think of is implementing > Windows' ConnectEx (which I am doing) I'm unclear on what you propose here; again, a working patch on SF showing what you propose would help. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4