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

How to close a connection in a seperate thread #25

Open
GuillaumeLeclerc opened this issue Apr 29, 2016 · 2 comments
Open

How to close a connection in a seperate thread #25

GuillaumeLeclerc opened this issue Apr 29, 2016 · 2 comments

Comments

@GuillaumeLeclerc
Copy link
Contributor

Hello,

I'm using this library in a multithreaded environment. When a new request arrives I add a new thread in a Thread pool. I managed to write from here using evbuffer_add.

I managed to do something by setting userdata. and at every event I check the content to know if I should return AD_CLOSE.

Is there a better way to do this ?

Thanks a lot

@GuillaumeLeclerc
Copy link
Contributor Author

Actually what I did only works for the first request. I get a SEGSEV on the second request. I'm a little lost

@wolkykim
Copy link
Owner

Hi,

returning AD_CLOSE is the right way to do it.
About SEGSEV, I have no clue where it happens unless I see the code but core dump might help you to identify the issue.

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

2 participants