-
-
Save Loopshape/d7b86b55130fdf68418494ac96c0f7f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a server AF_UNIX socket | |
#define SERVER_ADDRESS “c:\unix\server.sock” | |
SOCKADDR_UN ServerAddress = {0}; | |
Server = socket(AF_UNIX, SOCK_STREAM, 0); | |
// Bind the socket to a path. | |
ServerAddress.sun_family = AF_UNIX; | |
strcpy(ServerAddress.sun_path, SERVER_ADDRESS); | |
bind(Server, &ServerAddress, sizeof(ServerAddress)); | |
// Accept a connection. | |
listen(Server, 5); | |
Accepted = accept(Server, ….); | |
// Send and receive data on the accepted socket. | |
// Shutdown and close the connection. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment