-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
EVENT_READING | EVENT_ERROR after bufferevent_enable but before bufferevent_socket_connect #1295
Comments
AFAICS it should not happen. |
Oops. I can't reproduce it now. How i can enable max logging for libevent library without rebuild? When it starts again I will try to collect more information. |
I reproduce it. Output from "libevent-src.zip"
Step by step:
Reproducing is not 100% |
Thanks. You code has some issues, but this should not affect.
Can you provide strace log for such failure? And also separate output with |
Could you tell me more, please?
Of course. I will let you know how the results are. |
I modified source code for fast reproduce -- each data read we starting new connection. After 3-4 times issue is reproduce. Problem signature in logs:
stdout: Libevent version is 2.1.11-stable |
Like I thought the problem that you've enabled EV_READ before connect, you should not do so, since you can read from unconnected socket. |
Sure. Anyway here are some comments after a brief look: Basic anti patterns:
libevent anti patterns:
|
I have a simple TCP client.
Event loop working in thread
#1
useevent_base_loop(base, EVLOOP_ONCE)
.TCP connection starting in thread
#2
:<------ Here libevent call my event callback with BEV_EVENT_READING | BEV_EVENT_ERROR
Its normal behavior? I don't expect events before call bufferevent_socket_connect
The text was updated successfully, but these errors were encountered: