This commit is contained in:
veclavtlica
2026-09-11 02:21:21 +03:00
parent 2e890fb5b7
commit adfae10938
17 changed files with 949 additions and 119 deletions
+26
View File
@@ -0,0 +1,26 @@
/*
Inter-process communicating socket, useful for local testing and admin
playing.
*/
#include <stdio.h>
#include <sys/socket.h>
#include <sys/un.h>
#define MAXBUFFSIZE 4194304 /* 4.0MiB */
int plr_socket_unix_try_connect(const char *filepath) {
int sock = 0;
if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
perror("Error creating client UNIX socket: ");
return -1;
}
struct sockaddr_un remote = {0};
remote.sun_family = AF_UNIX;
strcpy(remote.sun_path, filepath);
int const remote_len = SUN_LEN(&remote);
return 0;
}