Skip to content

Commit 7cd5dbc

Browse files
jeffhostetlergitster
authored andcommitted
simple-ipc: add Unix domain socket implementation
Create Unix domain socket based implementation of "simple-ipc". A set of `ipc_client` routines implement a client library to connect to an `ipc_server` over a Unix domain socket, send a simple request, and receive a single response. Clients use blocking IO on the socket. A set of `ipc_server` routines implement a thread pool to listen for and concurrently service client connections. The server creates a new Unix domain socket at a known location. If a socket already exists with that name, the server tries to determine if another server is already listening on the socket or if the socket is dead. If socket is busy, the server exits with an error rather than stealing the socket. If the socket is dead, the server creates a new one and starts up. If while running, the server detects that its socket has been stolen by another server, it automatically exits. Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9fd1902 commit 7cd5dbc

File tree

4 files changed

+1015
-1
lines changed

4 files changed

+1015
-1
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,8 @@ ifdef NO_UNIX_SOCKETS
16781678
else
16791679
LIB_OBJS += unix-socket.o
16801680
LIB_OBJS += unix-stream-server.o
1681+
LIB_OBJS += compat/simple-ipc/ipc-shared.o
1682+
LIB_OBJS += compat/simple-ipc/ipc-unix-socket.o
16811683
endif
16821684

16831685
ifdef USE_WIN32_IPC

0 commit comments

Comments
 (0)