Comments (2)
@legale I suggest you don't reuse the ac->events.mqtt_loop.ev
. use event_new, then use event_free, avoid use event_del and event_assign.
You add an event for EV_READ and EV_WRITE, and select in the callback. Please note, most of the time, the sock can be writable, so the callback would be called, then I see you do a select in the callback.
And I suggest you use different events like ev_write and ev_read, then disable ev_write if there is nothing to write. Otherwise, you use the same event for both ev_read and ev_write, you need do select in the callback, then why do you use libevent? (That's the way of bufferevent_socket.) If the underlying socket is udp, you can use other magic way.
from libevent.
Looks like lines does not match.
Anyway it is hard to say something based on provided samples. But you can try to compile with TSan at least, and see what it will report about deadlocks. Also if you have threads, please make that you enabled pthread support (evthread_use_pthreads()
)
from libevent.
Related Issues (20)
- Segmentation fault after bufferevent_write HOT 7
- bufferevent_write deadlock HOT 4
- buffereven_write blocking problem HOT 1
- HTTP parser allows empty header names
- How to verify libevent release download with provided asc file? HOT 1
- New security rules (NULL check) HOT 3
- New security rules (other type)
- Websocket connection fails with 404 for request header "Connection: keep-alive, Upgrade" (Firefox) HOT 4
- HTTP parser does not properly strip spaces and tabs from the beginnings of header values
- Hard coding of unknown IP addresses(1.2.3.4 and 18.244.0.188) HOT 1
- NDK 编译 libevent + openssl
- NDK 编译 libevent-2.1.8-stable + openssl;成功编译
- Unexpected DNS resolve procedure if dual stack enviroment and multiple subdomain exists HOT 1
- lost call http_request_done sometimes as httpclient
- Support 16KB page size devices
- mbedstl double free (libevent-2.2.1-alpha-dev)
- Configure without SSL/TLS support in cmake
- Experts, may I ask when the current open source libraries will undergo version iteration and upgrade? HOT 1
- evdns caching for improved performance HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libevent.