report at bugs
Mar 19, 2012, 7:19 AM
Post #5 of 43
Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:
[issue14310] Socket duplication for windows
[In reply to]
I like the idea of having a frominfo() function. Though "info" is maybe too generic? Also, dupinfo() is probably better than duplicate, even though there is no dup involved.
But I also wonder if we can make this windows/unix agnostic?
on unix, you would achieve the same thing by:
1) getting fd with fileno()
2) sending it over a unix domain socket using sendmsg() (used for duplicating fds betwerrn processes
3) calling fromfd() on the target host.
We could have a uniform process (more or less) if dupinfo(pid) would return a string containing the fileno on linux, and frominfo() were to accept such a string too. The differeince between linux/windows would then be that linux needs to transfer the "info" between processes using the "magic" sendmsg() control info ona UNIX domain sock, whereas on Windows one can use whatever RPC one wishes. To implement this, we could therefore have special "sendinfo" and "recvinfo" functions.
The process would then become, on either platform:
1) info = dupinfo(pid)
But again: "info" is very generic here. any suggestions for a better name?
Python tracker <report [at] bugs>
Python-bugs-list mailing list