diff --git a/server/red_channel.c b/server/red_channel.c index be861fdd..cab56a0d 100644 --- a/server/red_channel.c +++ b/server/red_channel.c @@ -571,6 +571,11 @@ static PipeItem *red_channel_pipe_get(RedChannel *channel) return item; } +int red_channel_is_connected(RedChannel *channel) +{ + return !!channel->peer; +} + static void red_channel_pipe_clear(RedChannel *channel) { PipeItem *item; diff --git a/server/red_channel.h b/server/red_channel.h index 24f969b9..30adfc66 100644 --- a/server/red_channel.h +++ b/server/red_channel.h @@ -182,6 +182,8 @@ RedChannel *red_channel_create_parser(int size, RedsStreamContext *peer, channel_on_incoming_error_proc incoming_error, channel_on_outgoing_error_proc outgoing_error); +int red_channel_is_connected(RedChannel *channel); + void red_channel_destroy(RedChannel *channel); void red_channel_shutdown(RedChannel *channel);