[gnet] Use of conn and experimental IO functions



I'm considering moving the experimental IO functions in GNet
(gnet_io_channel_read_async, gnet_io_channel_write_async) to the GConn and
simplifying them.  They are difficult to use and bug prone (due to the
Linux/GLib poll problem).

Is anyone using them?  Is there any objection?

The new API may be this:

void	   gnet_conn_read (GConn* conn, func, ud);
void	   gnet_conn_readn (GConn* conn, gint length);
void	   gnet_conn_readline (GConn* conn);

void	   gnet_conn_write (GConn* conn, gchar* buffer, gint length);


And possibly:

void	   gnet_conn_enable_read_watch (GConn* conn);
void	   gnet_conn_disable_read_watch (GConn* conn);

void	   gnet_conn_enable_write_watch (GConn* conn);
void	   gnet_conn_disable_write_watch (GConn* conn);

with these new connection statuses
  GNET_CONN_STATUS_READABLE,
  GNET_CONN_STATUS_WRITEABLE,

or:
  gnet_conn_watch_readable (GConn* conn, gboolean enable);
  gnet_conn_watch_writeable (GConn* conn, gboolean enable);

This would at least allow people to safely use conn_read and due something
more complex for writes.

David


-- 
      __          _    __ David Helder - dhelder umich edu
  ___/ /__ __  __(_)__/ / <http://www.eecs.umich.edu/~dhelder>
 / _  / _ `/ |/ / / _  /  DiaWebLog: <http://www.diaweblog.org>
 |_,_/|_,_/|___/_/|_,_/   Paper CD Case: <http://www.papercdcase.com>





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