summaryrefslogtreecommitdiffstats
path: root/server/red_channel.h
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2012-02-16 23:30:11 -0600
committerAlon Levy <alevy@redhat.com>2012-02-21 10:20:46 +0200
commit143a1df24e83e9c1e173c16aeb76d61ffdce9598 (patch)
tree263b215626c7a566a028875a4cfb8547dc941e0f /server/red_channel.h
parentdfbac622bf9cbff7b4bdcabe78299621821ca61e (diff)
downloadspice-143a1df24e83e9c1e173c16aeb76d61ffdce9598.tar.gz
spice-143a1df24e83e9c1e173c16aeb76d61ffdce9598.tar.xz
spice-143a1df24e83e9c1e173c16aeb76d61ffdce9598.zip
red_worker: reimplement event loop using poll()
This removes the epoll dependency we had in red_worker, which was the last Linux-specific call we were using in the entire Spice server. Given we never have more than 10 file descriptors involved, there is little performance gain had here by using epoll() over poll(). The biggest change is introduction of a new pre_disconnect callback; this is because poll, unlike epoll, cannot automatically remove file descriptors as they are closed from the pollfd set. This cannot be done in the existing on_disconnect callback; that is too late as the stream has already been closed and the file descriptor lost. The on_disconnect callback can not be moved before the close and other operations easily because of some behavior that relies on client_num being set to a certain value. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Diffstat (limited to 'server/red_channel.h')
-rw-r--r--server/red_channel.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/server/red_channel.h b/server/red_channel.h
index 543aec18..a360a302 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -182,6 +182,7 @@ typedef void (*channel_client_migrate_proc)(RedChannelClient *base);
*/
typedef struct {
channel_configure_socket_proc config_socket;
+ channel_disconnect_proc pre_disconnect;
channel_disconnect_proc on_disconnect;
channel_send_pipe_item_proc send_item;
channel_hold_pipe_item_proc hold_item;