[gnet] callback isn't getting called



Hi.

sometimes gnet_conn_connect seems to be creating a tcp connection, but
my callback doesn't run.  This is strange because I use the same code
and same callback for all my gnet stuff, and so far it's been working.
(I'm doing rpc stuff.)  Now, I'm adding a new rpc message...  using the
same pathway in my application to use the gnet stuff, but now I'm not
getting a callback.  I watch with a packet sniffer (ethereal) and I see
a tcp connection is made and dropped (with SYNs and FINs, no RSTs), but
without passing any data and I never get a GNET_CONN_CONNECT event; like
I normally do.

All I can think up right now is...  this new use of the gnet stuff is
happening at a different place in my app.  I think this shouldn't make a
difference, but I don't know.

rough sequence of events:

- initiate gnet connect
- create modal dialog
- run setitimer( ITIMER_REAL ... ) # this could happen anywhere
- start processing dialog events
- receive connect event callback
- initiate gnet write
- receive write event callback
- initiate gnet read
- receive read event callback
- close gnet connection
- receive SIGALRM. re-run setitimer() # this could happen anywhere
- initiate new gnet connect
- wait forever for connect event callback
- press cancel button on dialog
- initiate gnet connect
- receive connect event callback
- the rest of the gnet session happens as expected

Does any of that ring a bell?  is the setitimer() and SIGALRM business
screwing up gnet somehow?  Is there something about a modal dialog that
causes gnet to work differently?  Am I calling connect too soon after I
close the gnet connection?  I'm not sure where to look right now.  I'd
expect to ALWAYS at least eventually receive SOME kind of event after
calling gnet_conn_connect(), especially if I'm seeing packets on the
wire.

Thanks very much,

- Anna




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