diff --git a/trunk/configure b/trunk/configure index 9bd61ef95..18ffd732c 100755 --- a/trunk/configure +++ b/trunk/configure @@ -189,7 +189,7 @@ APP_OBJS="${MODULE_OBJS[@]}" MODULE_ID="LIBS" MODULE_DEPENDS=("CORE" "KERNEL" "RTMP") ModuleLibIncs=(${SRS_OBJS}) -MODULE_FILES=("srs_librtmp") +MODULE_FILES=("srs_librtmp" "srs_lib_simple_socket") MODULE_DIR="src/libs" . auto/modules.sh LIBS_OBJS="${MODULE_OBJS[@]}" # diff --git a/trunk/src/libs/srs_lib_simple_socket.cpp b/trunk/src/libs/srs_lib_simple_socket.cpp new file mode 100644 index 000000000..9a0f03d05 --- /dev/null +++ b/trunk/src/libs/srs_lib_simple_socket.cpp @@ -0,0 +1,31 @@ +/* +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 + +SimpleSocketStream::SimpleSocketStream(int fd) { +} + +SimpleSocketStream::~SimpleSocketStream() { +} + diff --git a/trunk/src/libs/srs_lib_simple_socket.hpp b/trunk/src/libs/srs_lib_simple_socket.hpp new file mode 100644 index 000000000..4da261ae0 --- /dev/null +++ b/trunk/src/libs/srs_lib_simple_socket.hpp @@ -0,0 +1,42 @@ +/* +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_LIB_SIMPLE_SOCKET_HPP +#define SRS_LIB_SIMPLE_SOCKET_HPP + +/* +#include +*/ + +/** +* the stream over epoll: never wait for data coming, that is async mode. +*/ +class SimpleSocketStream +{ +public: + SimpleSocketStream(int fd); + virtual ~SimpleSocketStream(); +public: +}; + +#endif diff --git a/trunk/src/libs/srs_librtmp.cpp b/trunk/src/libs/srs_librtmp.cpp index 4231ec79d..e72e8779d 100644 --- a/trunk/src/libs/srs_librtmp.cpp +++ b/trunk/src/libs/srs_librtmp.cpp @@ -30,23 +30,7 @@ using namespace std; #include #include - -/** -* the stream over epoll: never wait for data coming, that is async mode. -*/ -class SimpleSocketStream -{ -private: - int sock; -public: - SimpleSocketStream(int fd){ - sock = fd; - } - virtual ~SimpleSocketStream() { - ::close(sock); - } -public: -}; +#include /** * export runtime context. diff --git a/trunk/src/srs/srs.upp b/trunk/src/srs/srs.upp index 0ef3fced5..38465c180 100644 --- a/trunk/src/srs/srs.upp +++ b/trunk/src/srs/srs.upp @@ -7,6 +7,8 @@ file libs readonly separator, ..\libs\srs_librtmp.hpp, ..\libs\srs_librtmp.cpp, + ..\libs\srs_lib_simple_socket.hpp, + ..\libs\srs_lib_simple_socket.cpp, core readonly separator, ..\core\srs_core.hpp, ..\core\srs_core.cpp,