ORBit2 / linc non-blocking API: change request
- From: Michael Meeks <michael ximian com>
- To: Jody Goldberg <jody ximian com>
- Cc: Release Team <gnome2-release-team gnome org>, Havoc Pennington <hp redhat com>, gnome-2-0-list gnome org
- Subject: ORBit2 / linc non-blocking API: change request
- Date: 28 Dec 2001 10:50:55 +0000
Hi Guys,
So - in response to the problem of Gconf blocking and causing all
subsequent gconf requests to block when a single client stops responding
[ a not altogether unexpected occurence ] - I've written a chunk of code
in linc to do explicit buffering, and a capability to sever a connection
that appears to be not responding ( based on the size of the buffer in
bytes ). I think the combination is neccessary for Gnome 2.0 to be
workable - however it introduces some API additions:
In the ORB we add:
Index: include/orbit/orb-core/orbit-small.h
+typedef struct _ORBitConnection ORBitConnection;
+
+ORBitConnection *ORBit_small_get_connection (CORBA_Object obj);
+void ORBit_connection_set_max_buffer (ORBitConnection *cnx,
+ gulong max_bytes);
The LINC API is also altered in an somewhat more drastic ( but long
term helpful ) fashion. This shouldn't really be a problem, since ORBit2
is the only known user of the linc API - which it conceals from the user
substantially.
So - I'd like to get this approved from an API review POV so we can
address the issue in gconf ASAP. The linc changes follow,
Regards,
Michael.
Index: include/linc/linc-connection.h
+typedef struct _LINCWriteOpts LINCWriteOpts;
...
/* signals */
void (* broken) (LINCConnection *cnx);
+ /*
+ * Emitted when the buffer is emptied, half full or
+ * before disconnect
+ */
+ void (* blocking) (LINCConnection *cnx,
+ gulong buffer_size);
} LINCConnectionClass;
GType linc_connection_get_type (void) G_GNUC_CONST;
...
+typedef enum {
+ LINC_IO_OK = 0,
+ LINC_IO_FATAL_ERROR = -1,
+ LINC_IO_QUEUED_DATA = -2
+} LINCIOStatus;
+
...
-int linc_connection_write (LINCConnection *cnx, const guchar
*buf, gulong len);
+LINCIOStatus linc_connection_write (LINCConnection *cnx,
+ const guchar *buf,
+ gulong len,
+ const LINCWriteOpts *opt_write_opts);
+
+LINCIOStatus linc_connection_writev (LINCConnection *cnx,
+ struct iovec *vecs,
+ int nvecs,
+ const LINCWriteOpts *opt_write_opts);
-int linc_connection_writev (LINCConnection *cnx, struct iovec
*vecs,
- int nvecs, gulong total_size);
...
+void linc_connection_set_max_buffer (LINCConnection *cnx,
+ gulong max_buffer_bytes);
+LINCWriteOpts *linc_write_options_new (gboolean
block_on_write);
+/* Space for future expansion: timeout, individual msg. buffering
constraints etc. */
+void linc_write_options_free (LINCWriteOpts
*write_opts);
Index: include/linc/linc-types.h
===================================================================
RCS file: /cvs/gnome/linc/include/linc/linc-types.h,v
retrieving revision 1.22
diff -u -p -u -r1.22 linc-types.h
--- include/linc/linc-types.h 2001/11/18 10:55:08 1.22
+++ include/linc/linc-types.h 2001/12/28 10:30:42
@@ -19,8 +19,9 @@
G_BEGIN_DECLS
typedef enum {
LINC_CONNECTION_SSL = 1 << 0,
LINC_CONNECTION_NONBLOCKING = 1 << 1,
+ LINC_CONNECTION_BLOCK_SIGNAL = 1 << 2
} LINCConnectionOptions;
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]