python / cpython

The Python programming language
https://www.python.org
Other
62.27k stars 29.92k forks source link

sendmsg() and recvmsg() for C socket module #41944

Closed aa7316a9-f344-4eca-8c1e-8f9977915087 closed 15 years ago

aa7316a9-f344-4eca-8c1e-8f9977915087 commented 19 years ago
BPO 1194378
Nosy @pitrou, @giampaolo, @ezio-melotti
Files
  • socketmodule.diff.tar.bz2: New patches to socketmodule.{c,h} to implement recvmsg and sendmsg in an abstraction.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = created_at = labels = ['extension-modules', 'type-feature'] title = 'sendmsg() and recvmsg() for C socket module' updated_at = user = 'https://bugs.python.org/hwundram' ``` bugs.python.org fields: ```python activity = actor = 'ezio.melotti' assignee = 'none' closed = True closed_date = closer = 'ezio.melotti' components = ['Extension Modules'] creation = creator = 'hwundram' dependencies = [] files = ['6639'] hgrepos = [] issue_num = 1194378 keywords = ['patch'] message_count = 6.0 messages = ['48287', '48288', '78264', '78358', '78369', '90973'] nosy_count = 8.0 nosy_names = ['beazley', 'pitrou', 'therve', 'forest', 'giampaolo.rodola', 'hwundram', 'ezio.melotti', 'gdesmott'] pr_nums = [] priority = 'low' resolution = 'duplicate' stage = 'resolved' status = 'closed' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue1194378' versions = ['Python 3.1', 'Python 2.7'] ```

    aa7316a9-f344-4eca-8c1e-8f9977915087 commented 19 years ago

    The following tar.bz2 contains a feature enhancement proposal for the socket module to create wrappings of the recvmsg and sendmsg primitives. These are sometimes useful, especially when dealing with ancillary messages, such as communicating the process, user and group id of a remote process to a server for proper identification.

    These functions have so far been available in a separate module (python-eunuchs from the twisted project), but as they are standard POSIX and have been available on *BSD, AIX, Linux and several other OSs for some time they should be integrated into the core socket module.

    The attached file contains patches for configure.in the socket module, socket.py and pyconfig.h.in. I've yet to write a test-suite, and the documentation could use some reworking.

    55c68216-1b09-421f-b5a4-c375afb3e360 commented 17 years ago

    That's really great, it's a shame this patch didn't get much interest. Do you feel like adding test to this, it would probably psuh for its inclusion ?

    1efe45e0-3fff-4905-80a3-b3581a2ab71f commented 15 years ago

    Bump. This functionality seems to be needed if anyone is going to be messing around with advanced features of IPv6. As it stands, the socket module in Python 2.6/3.0 is incomplete without this.

    1efe45e0-3fff-4905-80a3-b3581a2ab71f commented 15 years ago

    Just a followup comment to note that adding support for sendmsg()/recvmsg() is what you need to do "file descriptor passing" between processes on Unix---another technique for writing network servers.

    pitrou commented 15 years ago

    The patch doesn't apply cleanly to the current trunk (which is understandable, given the patch is from 2005). Also, some tests would be welcome as Thomas said. And bonus points for documentation :)

    ezio-melotti commented 15 years ago

    Closing this as duplicate of bpo-6560.