diff --git a/trunk/configure b/trunk/configure index c6daeeddee..a380aba72c 100755 --- a/trunk/configure +++ b/trunk/configure @@ -388,8 +388,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config" "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks" "srs_app_json" "srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge" - "srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac" - "srs_app_poll") + "srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac") APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh APP_OBJS="${MODULE_OBJS[@]}" fi diff --git a/trunk/src/app/srs_app_poll.cpp b/trunk/src/app/srs_app_poll.cpp deleted file mode 100644 index 66f24efff6..0000000000 --- a/trunk/src/app/srs_app_poll.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2013-2014 winlin - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include -#include - -SrsPoll::SrsPoll() -{ - _stfd = NULL; - _active = false; -} - -SrsPoll::~SrsPoll() -{ -} - -int SrsPoll::initialize(st_netfd_t stfd) -{ - int ret = ERROR_SUCCESS; - - _stfd = stfd; - - return ret; -} - -bool SrsPoll::active() -{ - return _active; -} - -void SrsPoll::set_active(bool v) -{ - _active = v; -} - diff --git a/trunk/src/app/srs_app_poll.hpp b/trunk/src/app/srs_app_poll.hpp deleted file mode 100644 index 67888c3a82..0000000000 --- a/trunk/src/app/srs_app_poll.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2013-2014 winlin - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef SRS_APP_POLL_HPP -#define SRS_APP_POLL_HPP - -/* -#include -*/ - -#include - -#include - -#include -#include - -/** -* the poll fd to check whether the specified fd is active. -* we start new thread to covert the fd status to async. -* for performance issue, @see: https://github.com/winlinvip/simple-rtmp-server/issues/194 -*/ -class SrsPoll -{ -private: - st_netfd_t _stfd; - // whether current fd is active. - bool _active; -public: - SrsPoll(); - virtual ~SrsPoll(); -public: - /** - * initialize the poll. - * @param stfd the fd to poll. - */ - virtual int initialize(st_netfd_t stfd); - /** - * whether fd is active. - */ - virtual bool active(); - /** - * the poll will set to fd active when got data to read, - * the connection will set to deactive when data read. - */ - virtual void set_active(bool v); -}; - -#endif - diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 6c289abea8..f26eeab5da 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -48,7 +48,6 @@ using namespace std; #include #include #include -#include // when stream is busy, for example, streaming is already // publishing, when a new client to request to publish, @@ -517,16 +516,10 @@ int SrsRtmpConn::playing(SrsSource* source) SrsAutoFree(SrsConsumer, consumer); srs_verbose("consumer created success."); - // use poll fd to manage the connection, read when active. - SrsPoll poll_fd; - if ((ret = poll_fd.initialize(stfd)) != ERROR_SUCCESS) { - return ret; - } - // TODO: FIXME: remove following. - //rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); - rtmp->set_recv_timeout(ST_UTIME_NO_TIMEOUT); - rtmp->set_send_timeout(ST_UTIME_NO_TIMEOUT); + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); + //rtmp->set_recv_timeout(ST_UTIME_NO_TIMEOUT); + //rtmp->set_send_timeout(ST_UTIME_NO_TIMEOUT); // initialize other components SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER); @@ -539,9 +532,7 @@ int SrsRtmpConn::playing(SrsSource* source) pithy_print.elapse(); // read from client. - if (poll_fd.active()) { - poll_fd.set_active(false); - + if (true) { SrsMessage* msg = NULL; ret = rtmp->recv_message(&msg); srs_verbose("play loop recv message. ret=%d", ret); @@ -574,9 +565,9 @@ int SrsRtmpConn::playing(SrsSource* source) // no data, sleep a while. // for the poll_fd maybe not active, and no message. // @see: https://github.com/winlinvip/simple-rtmp-server/issues/194 - if (count <= 0) { - st_usleep(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); - } + //if (count <= 0) { + // st_usleep(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); + //} // reportable if (pithy_print.can_print()) { diff --git a/trunk/src/kernel/srs_kernel_error.hpp b/trunk/src/kernel/srs_kernel_error.hpp index 1bf74e940f..21ca885deb 100644 --- a/trunk/src/kernel/srs_kernel_error.hpp +++ b/trunk/src/kernel/srs_kernel_error.hpp @@ -185,7 +185,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define ERROR_EDGE_VHOST_REMOVED 3039 #define ERROR_HLS_AVC_TRY_OTHERS 3040 #define ERROR_H264_API_NO_PREFIXED 3041 -#define ERROR_RTMP_POLL_FD_DUPLICATED 3042 /** * whether the error code is an system control error. diff --git a/trunk/src/srs/srs.upp b/trunk/src/srs/srs.upp index c73673d53a..5fa0bfbf97 100755 --- a/trunk/src/srs/srs.upp +++ b/trunk/src/srs/srs.upp @@ -92,8 +92,6 @@ file ..\app\srs_app_kbps.cpp, ..\app\srs_app_log.hpp, ..\app\srs_app_log.cpp, - ..\app\srs_app_poll.hpp, - ..\app\srs_app_poll.cpp, ..\app\srs_app_refer.hpp, ..\app\srs_app_refer.cpp, ..\app\srs_app_reload.hpp,