Message155842
| Author |
kristjan.jonsson |
| Recipients |
kristjan.jonsson |
| Date |
2012年03月15日.01:38:00 |
| SpamBayes Score |
1.9519757e-06 |
| Marked as misclassified |
No |
| Message-id |
<1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
winsock natively supports the duplciation of sockets for use on different processes. This patch proposes to add that functionality:
socket.duplicate(target_pid) gets a bytes representation of the duplicate socket, usable for the target process.
socket.socket(x,y,z,data) creates the socket object from the bytes representation.
The patch contains a test using multiprocessing that works.
Note that multiprocessing already contains its own code to achieve this, and that code can possibly be simplified with this patch.
Note also the new function "duplicate." Perhaps "dup(target_pid) would be better? But it would have different semantics.
Also notice how we overload the "fromfd" parameter in socket.socket() to recreate a socket from a bytes representation. Maybe this is not ideal?
Looking for thoughs here. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年03月15日 01:38:07 | kristjan.jonsson | set | recipients:
+ kristjan.jonsson |
| 2012年03月15日 01:38:06 | kristjan.jonsson | set | messageid: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> |
| 2012年03月15日 01:38:05 | kristjan.jonsson | link | issue14310 messages |
| 2012年03月15日 01:38:05 | kristjan.jonsson | create |
|