diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2012-04-07 11:23:31 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2012-04-07 11:23:31 (GMT) |
commit | 10f383a9376df13635bb53d5885d43297d0022cd (patch) | |
tree | c6ffb4eee7fabdaa0ffa87e5f6282e6b7a2e6f37 /Doc/library/socket.rst | |
parent | 0f9eec19ee1652a61d4b2e860e599c617d88b707 (diff) | |
download | cpython-10f383a9376df13635bb53d5885d43297d0022cd.zip cpython-10f383a9376df13635bb53d5885d43297d0022cd.tar.gz cpython-10f383a9376df13635bb53d5885d43297d0022cd.tar.bz2 |
Issue #14310: inter-process socket duplication for windows
Diffstat (limited to 'Doc/library/socket.rst')
-rw-r--r-- | Doc/library/socket.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 69fa378..0315507 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -680,6 +680,16 @@ The module :mod:`socket` exports the following constants and functions: .. versionadded:: 3.3 +.. function:: fromshare(data) + + Instantiate a socket from data obtained from :meth:`~socket.share`. + The socket is assumed to be in blocking mode. + + Availability: Windows. + + .. versionadded:: 3.3 + + .. data:: SocketType This is a Python type object that represents the socket object type. It is the @@ -1082,6 +1092,21 @@ correspond to Unix system calls applicable to sockets. are disallowed. If *how* is :const:`SHUT_RDWR`, further sends and receives are disallowed. + +.. method:: socket.share(process_id) + + :platform: Windows + + Duplacet a socket and prepare it for sharing with a target process. The + target process must be provided with *process_id*. The resulting bytes object + can then be passed to the target process using some form of interprocess + communication and the socket can be recreated there using :func:`fromshare`. + Once this method has been called, it is safe to close the socket since + the operating system has already duplicated it for the target process. + + .. versionadded:: 3.3 + + Note that there are no methods :meth:`read` or :meth:`write`; use :meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead. |