[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Write quirks in default eventbuffer implementation?
Hi folks,
First off, let me preface this in terms that I've used 1.x libevent
a bit in the past but given the 2.x release candidate I'm experimenting
with, I can't say what is proper and what is actually a bug. So, with that
in mind I'm not certain if this is me using things incorrectly or it really
is a bug.
Another note is that currently on Win32 I am using the default
configuration and not specifying iocp at this time. I'm using the async
listen/connect which I understand is non-functional in Win32 iocp based
implementations right now. As this is just a testbed to get used to 2.x rc,
I didn't feel the iocp was required to start with.
Anyway, here's what I'm seeing. So, I get a connection request from
my test client, there is no immediate communication so I just set the
callbacks and set EV_READ just in case the client immediately decides to
send a message (and get themselves kicked immediately for breaking
protocol). I do some processing in the server which validates that the IP
address is not on a ban list, or other wise not allowed. If everything is
ok, I then initiate a conversation with the client by challenging it.
So, anyway, it is at the challenge point where I'm getting a little
problem with my initial test. I grab the output evbuffer from event buffer
for the socket and then reserve/write/commit space into the evbuffer. I
then set the EV_WRITE event. At which point write does not happen until
some other event happens. Since the client is patiently waiting for the
server to challenge it, this means nothing ever happens. I added a
persistent timer to the event base and now the write happens when the timer
triggers.
Now, to somewhat prove that I'm not just doing something bad, the
same code under OsX and Linux seems to function as expected and the data
gets written immediately without needing the extra timer code. I'm just
guessing but maybe the select (I believe?) based version is not working
correctly in this case?
KB
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.