Comments (8)
I don't think that's possible with the way that most underlying socket APIs work: the functions that would notify you of errors are the same ones that try to do reading and writing.
If you know of some portable way to detect errors without doing reads/writes, then we can try to figure something out.
from libevent.
So basically I have no choice other than reading directly from the buffers? How will that work if the socket in question is SSL?
from libevent.
Libevent can handle all the heavy lifting /w managing SSL based sockets; see http://www.wangafu.net/~nickm/libevent-book/Ref6a_advanced_bufferevents.html for a few OpenSSL examples. After setting up the bufferevent you'd simply write to the output buffer just as you would for a normal bufferevent socket.
from libevent.
have my own layer around sockets
Is it a layer around libevent?
from libevent.
Oh crap, I forgot I already researched this topic a long time ago.
Potential new flags for turning off read but still get errors.
epoll:
EPOLLRDHUP works without EPOLLIN
kqueue:
EV_SET(&event, infd, EVFILT_READ, EV_ADD|EV_EOF, NOTE_LOWAT, INTMAX_MAX, NULL);
That looks like a hack, but it waits for INTMAX_MAX bytes before triggering the event, but still triggers EV_EOF
Would be interesting to look into a (kqueue and epoll) specific flag like "EV_READ_ERROR".
bufferevent_disable(EV_READ);
bufferevent_enable(EV_READ_ERROR);
from libevent.
from libevent.
Some backends will not support this
Like when I said
a (kqueue and epoll) specific flag
Also whats this I hear all about `the various flags specific to an event backend?
There will be all why-this-does-not-work questions,
We always get those; Even for things that do work - just document it and refer them to the libevent-book link.
but does it worth it?
No workarounds for backends that do not support it. Period.
The ability to have read disabled and still get socket errors would help every proxy developer in the world (53242423423.32432E) to be exact.
Joking aside, yes, this is definitely worth it (I've wanted this for a long time, never knew how to do it, then I realized I did, while browsing my documents folder).
from libevent.
Replacing and closing this ticket with #345
from libevent.
Related Issues (20)
- windows socks5 combo mbedtls client: [warn] BUG: Unexpected mbedtls error code -29184: SSL - An invalid SSL record was received HOT 1
- Class member functions to be param callback of event_new HOT 1
- deadlock on event_del_nolock_() HOT 2
- 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
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.