Add pollable input/output streams

When interfacing with APIs that expect unix-style async I/O, it is
useful to be able to tell in advance whether a read/write is going to
block. This adds new interfaces GPollableInputStream and
GPollableOutputStream that can be implemented by a GInputStream or
GOutputStream to add _is_readable/_is_writable, _create_source, and
_read_nonblocking/_write_nonblocking methods.

Also, implement for GUnixInput/OutputStream and
GSocketInput/OutputStream

https://bugzilla.gnome.org/show_bug.cgi?id=634241
This commit is contained in:
Dan Winship
2010-09-18 13:05:25 -04:00
parent 6181c7de36
commit c20c2c0abd
19 changed files with 1251 additions and 12 deletions

View File

@@ -60,8 +60,7 @@
* Since: 2.22
*/
G_DEFINE_TYPE (GSocketConnection,
g_socket_connection, G_TYPE_IO_STREAM);
G_DEFINE_TYPE (GSocketConnection, g_socket_connection, G_TYPE_IO_STREAM);
enum
{