Re: [gnet-dev] catching peer reset using async tcp



You get G_IO_IN sent to your callback, not G_IO_ERR.
There if you do a g_io_channel_read() you will get 0 bytes read.
Then you can handle that case, by freeing what you need to free etc.

In the case of echoserver.c, it jumps to:

error:
 clientstate_delete (client_state);
 return FALSE;
}

Andy

--On Monday, April 23, 2001 5:04 PM -0700 wroberts1 home com wrote:


I used the async method in echoserver example.

It works and all, but i need to catch the read errors
that sockets throw, like "connection reset by peer".

I was hoping that async iofunc would be called
with an error condition,  where i could free resources and
prepare for a reconnect.
_______________________________________________
gnet-dev mailing list
gnet-dev gnetlibrary org
http://www.gnetlibrary.org/mailman/listinfo/gnet-dev







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