[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

RE: [Libevent-users] Proper socket shutdown.



Hi Nick,

	Any luck on this?

> > >        Anywhere, here is a quick and dirty testbed for the problem.
> > >
> > > http://pastebin.com/QF4N2DEw
> > >
> > >        If you leave "USE_IOCP" set to 0 everything shuts down
> correctly.
> > > If you turn that flag on though, the EOF's are never seen.  I just got
> > this
> > > test case functional so forgive the dirty leaky implementation if you
> > will,
> > > but please do check that I'm not just making some other stupid error
> as
> > I'm
> > > still getting used to 2.0 changes.

	So, I've managed to poke around just a little since sending the
example code and not really found anything interesting as of yet but had an
evil thought.  I started wondering about the "shutdown" function being
unreliable with IOCP from your information.  I can't say for sure but I
started thinking about it and have a guess as to the problem which I will be
testing in an hour or two when I get home.  Here's the outline of what I'm
thinking may be happening:

1.	IOCP may not immediately send the shutdown due to some goofball
internal item and instead just appends it to the next outgoing packet.
2
.	Since I wait for no further data outgoing and only then set the
shutdown, but I don't send anything else, the shutdown never gets sent since
it doesn't have activity to tack itself onto.

	This certainly seems like an evil stupid thing IOCP could be doing
here. :(

KB

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.