-
-
Save Loopshape/0fe081ebed17a5431dd6b3d189a293e4 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 client AF_UNIX socket | |
#define SERVER_ADDRESS “/mnt/c/unix/server.sock” | |
SOCKADDR_UN ServerAddress = {0}; | |
Client = socket(AF_UNIX, SOCK_STREAM, 0); | |
// Bind the socket to a path. | |
ServerAddress.sun_family = AF_UNIX; | |
strcpy(ServerAddress.sun_path, SERVER_ADDRESS); | |
connect(Client, &ServerAddress, sizeof(ServerAddress)); | |
// Send and receive data on the connection. | |
// Shutdown and close the connection. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment