Re: [gnet] Global questions



On Tuesday 09 December 2003 11:00, Dusausoy Bruno wrote:

Hi,

> 2) Sometimes (not always), I have to send a message back to one or more
> connections (that's why I keep reference to them). I've seen that there
> is a function named «gnet_conn_set_watch_writable ()» to watch if data
> can be send to the socket. How do I use this ? Must I also set a
> callback for the GNET_CONN_WRITABLE event ? I see it like this :
>
> 	(...)
> 	gnet_conn_set_callback (connection, my_callback, my_datas);
> 	gnet_conn_set_watch_writable(connection, TRUE);
> 	(...)
> Is it correct ?

I don't think you need to bother with this. Just call

  gnet_conn_write(conn, buffer, length);

and be done with it. 

Cheers
-Tim




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