-
-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unix domain socket support #803
base: master
Are you sure you want to change the base?
Conversation
Maybe rename it if it also works on Windows? Maybe something like external_socket_path or something like this? |
Actually it is named "unix socket" (or AF_UNIX) on Windows: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/ |
I wanted to use unix domain socket since performance is important in my project, so I implemented based on ipkn/crow#379.
Instead of duplicating App and Server classes, I created wrapper class of acceptor so the existing Server class can be used for unix socket connection.
By specifying socket path with
app.unix_path()
(instead ofapp.port(port_num)
) the server will create and use that socket instead of listening a tcp socket. (I added example as example/example_unix_socket.cpp)Although it is named unix socket, this also works on windows.
If there is any problem please let me know.
Especially I am not sure if there is a better name than
unix_path()
. → renamed tolocal_socket_path
.