正在显示
5 个修改的文件
包含
77 行增加
和
18 行删除
| @@ -189,7 +189,7 @@ APP_OBJS="${MODULE_OBJS[@]}" | @@ -189,7 +189,7 @@ APP_OBJS="${MODULE_OBJS[@]}" | ||
| 189 | MODULE_ID="LIBS" | 189 | MODULE_ID="LIBS" |
| 190 | MODULE_DEPENDS=("CORE" "KERNEL" "RTMP") | 190 | MODULE_DEPENDS=("CORE" "KERNEL" "RTMP") |
| 191 | ModuleLibIncs=(${SRS_OBJS}) | 191 | ModuleLibIncs=(${SRS_OBJS}) |
| 192 | -MODULE_FILES=("srs_librtmp") | 192 | +MODULE_FILES=("srs_librtmp" "srs_lib_simple_socket") |
| 193 | MODULE_DIR="src/libs" . auto/modules.sh | 193 | MODULE_DIR="src/libs" . auto/modules.sh |
| 194 | LIBS_OBJS="${MODULE_OBJS[@]}" | 194 | LIBS_OBJS="${MODULE_OBJS[@]}" |
| 195 | # | 195 | # |
trunk/src/libs/srs_lib_simple_socket.cpp
0 → 100644
| 1 | +/* | ||
| 2 | +The MIT License (MIT) | ||
| 3 | + | ||
| 4 | +Copyright (c) 2013-2014 winlin | ||
| 5 | + | ||
| 6 | +Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| 7 | +this software and associated documentation files (the "Software"), to deal in | ||
| 8 | +the Software without restriction, including without limitation the rights to | ||
| 9 | +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| 10 | +the Software, and to permit persons to whom the Software is furnished to do so, | ||
| 11 | +subject to the following conditions: | ||
| 12 | + | ||
| 13 | +The above copyright notice and this permission notice shall be included in all | ||
| 14 | +copies or substantial portions of the Software. | ||
| 15 | + | ||
| 16 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| 18 | +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
| 19 | +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| 20 | +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 21 | +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 22 | +*/ | ||
| 23 | + | ||
| 24 | +#include <srs_lib_simple_socket.hpp> | ||
| 25 | + | ||
| 26 | +SimpleSocketStream::SimpleSocketStream(int fd) { | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +SimpleSocketStream::~SimpleSocketStream() { | ||
| 30 | +} | ||
| 31 | + |
trunk/src/libs/srs_lib_simple_socket.hpp
0 → 100644
| 1 | +/* | ||
| 2 | +The MIT License (MIT) | ||
| 3 | + | ||
| 4 | +Copyright (c) 2013-2014 winlin | ||
| 5 | + | ||
| 6 | +Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| 7 | +this software and associated documentation files (the "Software"), to deal in | ||
| 8 | +the Software without restriction, including without limitation the rights to | ||
| 9 | +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| 10 | +the Software, and to permit persons to whom the Software is furnished to do so, | ||
| 11 | +subject to the following conditions: | ||
| 12 | + | ||
| 13 | +The above copyright notice and this permission notice shall be included in all | ||
| 14 | +copies or substantial portions of the Software. | ||
| 15 | + | ||
| 16 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| 18 | +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
| 19 | +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| 20 | +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 21 | +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 22 | +*/ | ||
| 23 | + | ||
| 24 | +#ifndef SRS_LIB_SIMPLE_SOCKET_HPP | ||
| 25 | +#define SRS_LIB_SIMPLE_SOCKET_HPP | ||
| 26 | + | ||
| 27 | +/* | ||
| 28 | +#include <srs_lib_simple_socket.hpp> | ||
| 29 | +*/ | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | +* the stream over epoll: never wait for data coming, that is async mode. | ||
| 33 | +*/ | ||
| 34 | +class SimpleSocketStream | ||
| 35 | +{ | ||
| 36 | +public: | ||
| 37 | + SimpleSocketStream(int fd); | ||
| 38 | + virtual ~SimpleSocketStream(); | ||
| 39 | +public: | ||
| 40 | +}; | ||
| 41 | + | ||
| 42 | +#endif |
| @@ -30,23 +30,7 @@ using namespace std; | @@ -30,23 +30,7 @@ using namespace std; | ||
| 30 | 30 | ||
| 31 | #include <srs_kernel_error.hpp> | 31 | #include <srs_kernel_error.hpp> |
| 32 | #include <srs_protocol_rtmp.hpp> | 32 | #include <srs_protocol_rtmp.hpp> |
| 33 | - | ||
| 34 | -/** | ||
| 35 | -* the stream over epoll: never wait for data coming, that is async mode. | ||
| 36 | -*/ | ||
| 37 | -class SimpleSocketStream | ||
| 38 | -{ | ||
| 39 | -private: | ||
| 40 | - int sock; | ||
| 41 | -public: | ||
| 42 | - SimpleSocketStream(int fd){ | ||
| 43 | - sock = fd; | ||
| 44 | - } | ||
| 45 | - virtual ~SimpleSocketStream() { | ||
| 46 | - ::close(sock); | ||
| 47 | - } | ||
| 48 | -public: | ||
| 49 | -}; | 33 | +#include <srs_lib_simple_socket.hpp> |
| 50 | 34 | ||
| 51 | /** | 35 | /** |
| 52 | * export runtime context. | 36 | * export runtime context. |
| @@ -7,6 +7,8 @@ file | @@ -7,6 +7,8 @@ file | ||
| 7 | libs readonly separator, | 7 | libs readonly separator, |
| 8 | ..\libs\srs_librtmp.hpp, | 8 | ..\libs\srs_librtmp.hpp, |
| 9 | ..\libs\srs_librtmp.cpp, | 9 | ..\libs\srs_librtmp.cpp, |
| 10 | + ..\libs\srs_lib_simple_socket.hpp, | ||
| 11 | + ..\libs\srs_lib_simple_socket.cpp, | ||
| 10 | core readonly separator, | 12 | core readonly separator, |
| 11 | ..\core\srs_core.hpp, | 13 | ..\core\srs_core.hpp, |
| 12 | ..\core\srs_core.cpp, | 14 | ..\core\srs_core.cpp, |
-
请 注册 或 登录 后发表评论