libasyncd icon indicating copy to clipboard operation
libasyncd copied to clipboard

How to close a connection in a seperate thread

Open GuillaumeLeclerc opened this issue 8 years ago • 2 comments

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 avatar Apr 29 '16 22:04 GuillaumeLeclerc

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

GuillaumeLeclerc avatar Apr 29 '16 23:04 GuillaumeLeclerc

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.

wolkykim avatar Apr 29 '16 23:04 wolkykim