Skip to content

#119: Implemented Connection Acceptor - #124

Open
sgn4sangar wants to merge 1 commit into
mainfrom
feature/119_connection_acceptor
Open

sgn4sangar wants to merge 1 commit into
mainfrom
feature/119_connection_acceptor

Conversation

@sgn4sangar

Copy link
Copy Markdown
Collaborator

fixes #119

@sgn4sangar
sgn4sangar requested a deployment to v2-fuzzing-pr-approval November 6, 2026 08:01 — with GitHub Actions Waiting
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

Comment on lines +59 to +62
`shutdown()` destroys the owned `SocketListener`. For a Unix listener this
closes the listener and removes its bound socket path. The caller must not race
`shutdown()` with `get_next_connection`; shutdown takes effect before the next
acceptance attempt rather than interrupting an in-progress one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesnt work properly, also if you prevent a race with a mutex, the get_next_connection might wait without timeout and the a potential parallel shutdown signal can't simply close the socket, because under linux this doesnt wake the thread that currently blocks in accept. You need to use epoll and a eventfd. you register the listener socket and the eventfd at the epoll and wait on the epoll. shutdown then sends a message to the eventfd and wakes up the thread waiting for a connection. futhermore shutdown should marke the connectionacceptor as shutdown and prevent further waits. the socketlistener is then in the destructor destroyed

## Interfaces and ownership

```cpp
enum class ConnectionType { UnixDomainSocket, Tcp, Tls };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
enum class ConnectionType { UnixDomainSocket, Tcp, Tls };
enum class ConnectionType { UnixDomainSocket, Tcp };

This branch is waiting to be deployed

1 waiting deployment
v2-fuzzing-pr-approval — 65fe3f51 Waiting Nov 6, 2026 by sgn4sangar via pr_approval #322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connection Acceptor - to handle multiple connection types

2 participants