Skip to content

Commit 5f4dbcb

Browse files
author
Lluís Vilanova
committed
drivers/unix_socket: Ignore additional clients
Only one client connection is supported now, so ignore new ones as long as the current connection is not severed.
1 parent 36c7ed7 commit 5f4dbcb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

core/drivers/unix_socket.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ void UnixSocketPort::AcceptThread() {
8080
}
8181
if (fd < 0) {
8282
PLOG(ERROR) << "[UnixSocketPort]:accept4()";
83+
} else if (client_fd_ != kNotConnectedFd) {
84+
LOG(WARNING) << "[UnixSocketPort]: Ignoring additional client\n";
85+
close(fd);
8386
} else {
8487
client_fd_ = fd;
8588
}

0 commit comments

Comments
 (0)