Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of queued clients and timeout #4

Open
v6ops opened this issue Mar 15, 2024 · 0 comments
Open

Handling of queued clients and timeout #4

v6ops opened this issue Mar 15, 2024 · 0 comments

Comments

@v6ops
Copy link

v6ops commented Mar 15, 2024

Hi,

First thanks so much for sharing your code. There really are very few usable examples of multithreaded libevent that can be used as a tutorial.

I see something that I perceive as an issue. Correct me if I'm wrong.

I start a server with 2 threads on a server with 2 CPU.
I connect 3 independent telnet clients a,b,c close in time to each other to create congestion.

client a connects and echos immediately. There are messages from thread [10] on the server
client b connects and echos immediately. There are messages from thread [14] on the server
client c connects immediately (process is listening) but does not echo (event is not triggering).
I'd expect this as there are #define CONNECTION_BACKLOG 8 on the TCP socket.

I now leave client b to time out after SOCKET_READ_TIMEOUT_SECONDS 100.
Client a continues working normally. Client c is never serviced.

Now what I think is abnormal. Client b times out expires. Client c times out simultaneously and never gets serviced.

Is this expected behaviour, a bug, or a limitation in libevent?

Shouldn't the code be using something like evconnlistener_new_bind rather than listening and binding independently of libevent?

I can debug further on request if you're still maintaining this code.

best regards.

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

No branches or pull requests

1 participant