Skip to content

Add Unix domain socket support.#6

Closed
ghost wants to merge 4 commits intomasterfrom
unknown repository
Closed

Add Unix domain socket support.#6
ghost wants to merge 4 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented May 26, 2020

Updates:

  • Add support for Unix domain sockets in hsocket.
    • Rearranged some code so that many of them can be reused, reducing boilerplates.
  • Add Unix stream/datagram socket server/client API in hloop.
  • Add Unix domain socket support in server/client examples.
    • tcp.c and udp.c examples renamed to stream_server.c and dgram_server.c, and by specifying --unix argument, the server will bind to Unix domain socket instead of IP ports.
    • Add Unix domain socket client support in nc.c (-U and -D arguments).
  • Update README documentation for the new features.

Notes:

  • Although Windows began supporting Unix domain sockets as of late 2018, it is not supported yet in this pull request.
  • This feature is not enabled by default, change ENABLE_UDS=yes in config.mk to enable it.

@ithewei
Copy link
Owner

ithewei commented May 28, 2020

Thank you for contribution, I've added support for Unix Domain Socket based on your PR.
But I only add it to hsocket and will not add to hloop ( haccept、hconnect、hread、hwrite、hclose can pass fd directly )

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants