From affcdb0a4f562df58e405c978480b7382d116dad Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Mon, 13 Jun 2011 16:41:52 -0400 Subject: [PATCH] Make all sockets non-blocking --- src/mod/endpoints/mod_rtmp/rtmp_tcp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mod/endpoints/mod_rtmp/rtmp_tcp.c b/src/mod/endpoints/mod_rtmp/rtmp_tcp.c index 6ed2b49e67..b09cef7ad1 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp_tcp.c +++ b/src/mod/endpoints/mod_rtmp/rtmp_tcp.c @@ -215,6 +215,11 @@ void *SWITCH_THREAD_FUNC rtmp_io_tcp_thread(switch_thread_t *thread, void *obj) } } else { rtmp_session_t *newsession; + + if (switch_socket_opt_set(newsocket, SWITCH_SO_NONBLOCK, TRUE)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Couldn't set socket as non-blocking\n"); + } + if (rtmp_session_request(io->base.profile, &newsession) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTMP session request failed\n"); switch_socket_close(newsocket);