Skip to content

Added support for unix sockets#3152

Open
kSkip wants to merge 1 commit into
davisking:masterfrom
kSkip:unix-sockets
Open

Added support for unix sockets#3152
kSkip wants to merge 1 commit into
davisking:masterfrom
kSkip:unix-sockets

Conversation

@kSkip

@kSkip kSkip commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

I'm working on a Fast CGI server for my ML models and would like to integrate supporting changes into dlib's networking module. One of these changes is supporting socket type AF_UNIX, so web servers like nginx can bypass the network stack when communicating with the fcgi server. Another is a listener factory method that can accept connections on a user-provided socket. In many fast cgi setups, the application is expected to listen on stdin (which is bounded to a socket), so the user-provided socket is helpful here.

I implemented the required changes for both posix and win32 including tests. However, I'm not sure how to test the new create_listener_from_socket method. It would require platform specific code in the unit test.

);
/*!
requires
- sock is either a ICP/IP socket or a Unix socket

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- sock is either a ICP/IP socket or a Unix socket
- sock is either a TCP/IP socket or a Unix socket

@davisking

Copy link
Copy Markdown
Owner

I implemented the required changes for both posix and win32 including tests. However, I'm not sure how to test the new create_listener_from_socket method. It would require platform specific code in the unit test.

How are you making the socket you have when you call create_listener_from_socket() in your real application? Can't just do basically that in the tests or even better have an abstracted generic method for doing it?

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