正在显示
20 个修改的文件
包含
207 行增加
和
284 行删除
| @@ -168,7 +168,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then | @@ -168,7 +168,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then | ||
| 168 | MODULE_ID="APP" | 168 | MODULE_ID="APP" |
| 169 | MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL") | 169 | MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL") |
| 170 | ModuleLibIncs=(${LibSTRoot} ${LibHttpParserRoot} ${SRS_OBJS_DIR}) | 170 | ModuleLibIncs=(${LibSTRoot} ${LibHttpParserRoot} ${SRS_OBJS_DIR}) |
| 171 | - MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_st_socket" "srs_app_source" | 171 | + MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_source" |
| 172 | "srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" | 172 | "srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" |
| 173 | "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config" | 173 | "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config" |
| 174 | "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks" | 174 | "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks" |
| @@ -131,8 +131,6 @@ file | @@ -131,8 +131,6 @@ file | ||
| 131 | ../../src/app/srs_app_server.cpp, | 131 | ../../src/app/srs_app_server.cpp, |
| 132 | ../../src/app/srs_app_st.hpp, | 132 | ../../src/app/srs_app_st.hpp, |
| 133 | ../../src/app/srs_app_st.cpp, | 133 | ../../src/app/srs_app_st.cpp, |
| 134 | - ../../src/app/srs_app_st_socket.hpp, | ||
| 135 | - ../../src/app/srs_app_st_socket.cpp, | ||
| 136 | ../../src/app/srs_app_statistic.hpp, | 134 | ../../src/app/srs_app_statistic.hpp, |
| 137 | ../../src/app/srs_app_statistic.cpp, | 135 | ../../src/app/srs_app_statistic.cpp, |
| 138 | ../../src/app/srs_app_source.hpp, | 136 | ../../src/app/srs_app_source.hpp, |
| @@ -95,7 +95,6 @@ | @@ -95,7 +95,6 @@ | ||
| 95 | <ClInclude Include="..\..\src\app\srs_app_source.hpp" /> | 95 | <ClInclude Include="..\..\src\app\srs_app_source.hpp" /> |
| 96 | <ClInclude Include="..\..\src\app\srs_app_st.hpp" /> | 96 | <ClInclude Include="..\..\src\app\srs_app_st.hpp" /> |
| 97 | <ClInclude Include="..\..\src\app\srs_app_statistic.hpp" /> | 97 | <ClInclude Include="..\..\src\app\srs_app_statistic.hpp" /> |
| 98 | - <ClInclude Include="..\..\src\app\srs_app_st_socket.hpp" /> | ||
| 99 | <ClInclude Include="..\..\src\app\srs_app_thread.hpp" /> | 98 | <ClInclude Include="..\..\src\app\srs_app_thread.hpp" /> |
| 100 | <ClInclude Include="..\..\src\app\srs_app_utility.hpp" /> | 99 | <ClInclude Include="..\..\src\app\srs_app_utility.hpp" /> |
| 101 | <ClInclude Include="..\..\src\core\srs_core.hpp" /> | 100 | <ClInclude Include="..\..\src\core\srs_core.hpp" /> |
| @@ -176,7 +175,6 @@ | @@ -176,7 +175,6 @@ | ||
| 176 | <ClCompile Include="..\..\src\app\srs_app_source.cpp" /> | 175 | <ClCompile Include="..\..\src\app\srs_app_source.cpp" /> |
| 177 | <ClCompile Include="..\..\src\app\srs_app_st.cpp" /> | 176 | <ClCompile Include="..\..\src\app\srs_app_st.cpp" /> |
| 178 | <ClCompile Include="..\..\src\app\srs_app_statistic.cpp" /> | 177 | <ClCompile Include="..\..\src\app\srs_app_statistic.cpp" /> |
| 179 | - <ClCompile Include="..\..\src\app\srs_app_st_socket.cpp" /> | ||
| 180 | <ClCompile Include="..\..\src\app\srs_app_thread.cpp" /> | 178 | <ClCompile Include="..\..\src\app\srs_app_thread.cpp" /> |
| 181 | <ClCompile Include="..\..\src\app\srs_app_utility.cpp" /> | 179 | <ClCompile Include="..\..\src\app\srs_app_utility.cpp" /> |
| 182 | <ClCompile Include="..\..\src\core\srs_core.cpp" /> | 180 | <ClCompile Include="..\..\src\core\srs_core.cpp" /> |
| @@ -103,9 +103,6 @@ | @@ -103,9 +103,6 @@ | ||
| 103 | <ClCompile Include="..\..\src\app\srs_app_st.cpp"> | 103 | <ClCompile Include="..\..\src\app\srs_app_st.cpp"> |
| 104 | <Filter>srs</Filter> | 104 | <Filter>srs</Filter> |
| 105 | </ClCompile> | 105 | </ClCompile> |
| 106 | - <ClCompile Include="..\..\src\app\srs_app_st_socket.cpp"> | ||
| 107 | - <Filter>srs</Filter> | ||
| 108 | - </ClCompile> | ||
| 109 | <ClCompile Include="..\..\src\app\srs_app_statistic.cpp"> | 106 | <ClCompile Include="..\..\src\app\srs_app_statistic.cpp"> |
| 110 | <Filter>srs</Filter> | 107 | <Filter>srs</Filter> |
| 111 | </ClCompile> | 108 | </ClCompile> |
| @@ -327,9 +324,6 @@ | @@ -327,9 +324,6 @@ | ||
| 327 | <ClInclude Include="..\..\src\app\srs_app_st.hpp"> | 324 | <ClInclude Include="..\..\src\app\srs_app_st.hpp"> |
| 328 | <Filter>srs</Filter> | 325 | <Filter>srs</Filter> |
| 329 | </ClInclude> | 326 | </ClInclude> |
| 330 | - <ClInclude Include="..\..\src\app\srs_app_st_socket.hpp"> | ||
| 331 | - <Filter>srs</Filter> | ||
| 332 | - </ClInclude> | ||
| 333 | <ClInclude Include="..\..\src\app\srs_app_statistic.hpp"> | 327 | <ClInclude Include="..\..\src\app\srs_app_statistic.hpp"> |
| 334 | <Filter>srs</Filter> | 328 | <Filter>srs</Filter> |
| 335 | </ClInclude> | 329 | </ClInclude> |
| @@ -63,7 +63,6 @@ | @@ -63,7 +63,6 @@ | ||
| 63 | 3C1232B01AAE81D900CE8F6C /* srs_app_security.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232841AAE81D900CE8F6C /* srs_app_security.cpp */; }; | 63 | 3C1232B01AAE81D900CE8F6C /* srs_app_security.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232841AAE81D900CE8F6C /* srs_app_security.cpp */; }; |
| 64 | 3C1232B11AAE81D900CE8F6C /* srs_app_server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232861AAE81D900CE8F6C /* srs_app_server.cpp */; }; | 64 | 3C1232B11AAE81D900CE8F6C /* srs_app_server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232861AAE81D900CE8F6C /* srs_app_server.cpp */; }; |
| 65 | 3C1232B21AAE81D900CE8F6C /* srs_app_source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232881AAE81D900CE8F6C /* srs_app_source.cpp */; }; | 65 | 3C1232B21AAE81D900CE8F6C /* srs_app_source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232881AAE81D900CE8F6C /* srs_app_source.cpp */; }; |
| 66 | - 3C1232B31AAE81D900CE8F6C /* srs_app_st_socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12328A1AAE81D900CE8F6C /* srs_app_st_socket.cpp */; }; | ||
| 67 | 3C1232B41AAE81D900CE8F6C /* srs_app_st.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12328C1AAE81D900CE8F6C /* srs_app_st.cpp */; }; | 66 | 3C1232B41AAE81D900CE8F6C /* srs_app_st.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12328C1AAE81D900CE8F6C /* srs_app_st.cpp */; }; |
| 68 | 3C1232B51AAE81D900CE8F6C /* srs_app_statistic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12328E1AAE81D900CE8F6C /* srs_app_statistic.cpp */; }; | 67 | 3C1232B51AAE81D900CE8F6C /* srs_app_statistic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12328E1AAE81D900CE8F6C /* srs_app_statistic.cpp */; }; |
| 69 | 3C1232B61AAE81D900CE8F6C /* srs_app_thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232901AAE81D900CE8F6C /* srs_app_thread.cpp */; }; | 68 | 3C1232B61AAE81D900CE8F6C /* srs_app_thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232901AAE81D900CE8F6C /* srs_app_thread.cpp */; }; |
| @@ -235,8 +234,6 @@ | @@ -235,8 +234,6 @@ | ||
| 235 | 3C1232871AAE81D900CE8F6C /* srs_app_server.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_server.hpp; path = ../../../src/app/srs_app_server.hpp; sourceTree = "<group>"; }; | 234 | 3C1232871AAE81D900CE8F6C /* srs_app_server.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_server.hpp; path = ../../../src/app/srs_app_server.hpp; sourceTree = "<group>"; }; |
| 236 | 3C1232881AAE81D900CE8F6C /* srs_app_source.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_source.cpp; path = ../../../src/app/srs_app_source.cpp; sourceTree = "<group>"; }; | 235 | 3C1232881AAE81D900CE8F6C /* srs_app_source.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_source.cpp; path = ../../../src/app/srs_app_source.cpp; sourceTree = "<group>"; }; |
| 237 | 3C1232891AAE81D900CE8F6C /* srs_app_source.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_source.hpp; path = ../../../src/app/srs_app_source.hpp; sourceTree = "<group>"; }; | 236 | 3C1232891AAE81D900CE8F6C /* srs_app_source.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_source.hpp; path = ../../../src/app/srs_app_source.hpp; sourceTree = "<group>"; }; |
| 238 | - 3C12328A1AAE81D900CE8F6C /* srs_app_st_socket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_st_socket.cpp; path = ../../../src/app/srs_app_st_socket.cpp; sourceTree = "<group>"; }; | ||
| 239 | - 3C12328B1AAE81D900CE8F6C /* srs_app_st_socket.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_st_socket.hpp; path = ../../../src/app/srs_app_st_socket.hpp; sourceTree = "<group>"; }; | ||
| 240 | 3C12328C1AAE81D900CE8F6C /* srs_app_st.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_st.cpp; path = ../../../src/app/srs_app_st.cpp; sourceTree = "<group>"; }; | 237 | 3C12328C1AAE81D900CE8F6C /* srs_app_st.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_st.cpp; path = ../../../src/app/srs_app_st.cpp; sourceTree = "<group>"; }; |
| 241 | 3C12328D1AAE81D900CE8F6C /* srs_app_st.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_st.hpp; path = ../../../src/app/srs_app_st.hpp; sourceTree = "<group>"; }; | 238 | 3C12328D1AAE81D900CE8F6C /* srs_app_st.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_st.hpp; path = ../../../src/app/srs_app_st.hpp; sourceTree = "<group>"; }; |
| 242 | 3C12328E1AAE81D900CE8F6C /* srs_app_statistic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_statistic.cpp; path = ../../../src/app/srs_app_statistic.cpp; sourceTree = "<group>"; }; | 239 | 3C12328E1AAE81D900CE8F6C /* srs_app_statistic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_statistic.cpp; path = ../../../src/app/srs_app_statistic.cpp; sourceTree = "<group>"; }; |
| @@ -582,8 +579,6 @@ | @@ -582,8 +579,6 @@ | ||
| 582 | 3C1232871AAE81D900CE8F6C /* srs_app_server.hpp */, | 579 | 3C1232871AAE81D900CE8F6C /* srs_app_server.hpp */, |
| 583 | 3C1232881AAE81D900CE8F6C /* srs_app_source.cpp */, | 580 | 3C1232881AAE81D900CE8F6C /* srs_app_source.cpp */, |
| 584 | 3C1232891AAE81D900CE8F6C /* srs_app_source.hpp */, | 581 | 3C1232891AAE81D900CE8F6C /* srs_app_source.hpp */, |
| 585 | - 3C12328A1AAE81D900CE8F6C /* srs_app_st_socket.cpp */, | ||
| 586 | - 3C12328B1AAE81D900CE8F6C /* srs_app_st_socket.hpp */, | ||
| 587 | 3C12328C1AAE81D900CE8F6C /* srs_app_st.cpp */, | 582 | 3C12328C1AAE81D900CE8F6C /* srs_app_st.cpp */, |
| 588 | 3C12328D1AAE81D900CE8F6C /* srs_app_st.hpp */, | 583 | 3C12328D1AAE81D900CE8F6C /* srs_app_st.hpp */, |
| 589 | 3C12328E1AAE81D900CE8F6C /* srs_app_statistic.cpp */, | 584 | 3C12328E1AAE81D900CE8F6C /* srs_app_statistic.cpp */, |
| @@ -901,7 +896,6 @@ | @@ -901,7 +896,6 @@ | ||
| 901 | 3C663F121AB0155100286D8B /* srs_detect_rtmp.c in Sources */, | 896 | 3C663F121AB0155100286D8B /* srs_detect_rtmp.c in Sources */, |
| 902 | 3C1232B11AAE81D900CE8F6C /* srs_app_server.cpp in Sources */, | 897 | 3C1232B11AAE81D900CE8F6C /* srs_app_server.cpp in Sources */, |
| 903 | 3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */, | 898 | 3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */, |
| 904 | - 3C1232B31AAE81D900CE8F6C /* srs_app_st_socket.cpp in Sources */, | ||
| 905 | 3C1232061AAE812C00CE8F6C /* srs_main_server.cpp in Sources */, | 899 | 3C1232061AAE812C00CE8F6C /* srs_main_server.cpp in Sources */, |
| 906 | 3C1232281AAE814D00CE8F6C /* srs_kernel_mp3.cpp in Sources */, | 900 | 3C1232281AAE814D00CE8F6C /* srs_kernel_mp3.cpp in Sources */, |
| 907 | 3C1232B21AAE81D900CE8F6C /* srs_app_source.cpp in Sources */, | 901 | 3C1232B21AAE81D900CE8F6C /* srs_app_source.cpp in Sources */, |
| @@ -38,7 +38,7 @@ using namespace std; | @@ -38,7 +38,7 @@ using namespace std; | ||
| 38 | #include <srs_kernel_flv.hpp> | 38 | #include <srs_kernel_flv.hpp> |
| 39 | #include <srs_rtmp_stack.hpp> | 39 | #include <srs_rtmp_stack.hpp> |
| 40 | #include <srs_rtmp_utility.hpp> | 40 | #include <srs_rtmp_utility.hpp> |
| 41 | -#include <srs_app_st_socket.hpp> | 41 | +#include <srs_app_st.hpp> |
| 42 | #include <srs_app_utility.hpp> | 42 | #include <srs_app_utility.hpp> |
| 43 | #include <srs_rtmp_amf0.hpp> | 43 | #include <srs_rtmp_amf0.hpp> |
| 44 | #include <srs_kernel_utility.hpp> | 44 | #include <srs_kernel_utility.hpp> |
| @@ -35,7 +35,7 @@ using namespace std; | @@ -35,7 +35,7 @@ using namespace std; | ||
| 35 | #include <srs_rtmp_io.hpp> | 35 | #include <srs_rtmp_io.hpp> |
| 36 | #include <srs_app_config.hpp> | 36 | #include <srs_app_config.hpp> |
| 37 | #include <srs_rtmp_utility.hpp> | 37 | #include <srs_rtmp_utility.hpp> |
| 38 | -#include <srs_app_st_socket.hpp> | 38 | +#include <srs_app_st.hpp> |
| 39 | #include <srs_app_source.hpp> | 39 | #include <srs_app_source.hpp> |
| 40 | #include <srs_app_pithy_print.hpp> | 40 | #include <srs_app_pithy_print.hpp> |
| 41 | #include <srs_core_autofree.hpp> | 41 | #include <srs_core_autofree.hpp> |
| @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | using namespace std; | 31 | using namespace std; |
| 32 | 32 | ||
| 33 | #include <srs_app_source.hpp> | 33 | #include <srs_app_source.hpp> |
| 34 | -#include <srs_app_st_socket.hpp> | 34 | +#include <srs_app_st.hpp> |
| 35 | #include <srs_kernel_error.hpp> | 35 | #include <srs_kernel_error.hpp> |
| 36 | #include <srs_kernel_log.hpp> | 36 | #include <srs_kernel_log.hpp> |
| 37 | #include <srs_app_config.hpp> | 37 | #include <srs_app_config.hpp> |
| @@ -30,7 +30,7 @@ using namespace std; | @@ -30,7 +30,7 @@ using namespace std; | ||
| 30 | 30 | ||
| 31 | #include <srs_kernel_log.hpp> | 31 | #include <srs_kernel_log.hpp> |
| 32 | #include <srs_kernel_error.hpp> | 32 | #include <srs_kernel_error.hpp> |
| 33 | -#include <srs_app_st_socket.hpp> | 33 | +#include <srs_app_st.hpp> |
| 34 | #include <srs_core_autofree.hpp> | 34 | #include <srs_core_autofree.hpp> |
| 35 | #include <srs_app_json.hpp> | 35 | #include <srs_app_json.hpp> |
| 36 | #include <srs_kernel_utility.hpp> | 36 | #include <srs_kernel_utility.hpp> |
| @@ -31,7 +31,7 @@ using namespace std; | @@ -31,7 +31,7 @@ using namespace std; | ||
| 31 | 31 | ||
| 32 | #include <srs_kernel_error.hpp> | 32 | #include <srs_kernel_error.hpp> |
| 33 | #include <srs_kernel_log.hpp> | 33 | #include <srs_kernel_log.hpp> |
| 34 | -#include <srs_app_st_socket.hpp> | 34 | +#include <srs_app_st.hpp> |
| 35 | #include <srs_kernel_utility.hpp> | 35 | #include <srs_kernel_utility.hpp> |
| 36 | #include <srs_app_utility.hpp> | 36 | #include <srs_app_utility.hpp> |
| 37 | #include <srs_core_autofree.hpp> | 37 | #include <srs_core_autofree.hpp> |
| @@ -37,7 +37,7 @@ using namespace std; | @@ -37,7 +37,7 @@ using namespace std; | ||
| 37 | #include <srs_rtmp_utility.hpp> | 37 | #include <srs_rtmp_utility.hpp> |
| 38 | #include <srs_kernel_log.hpp> | 38 | #include <srs_kernel_log.hpp> |
| 39 | #include <srs_kernel_error.hpp> | 39 | #include <srs_kernel_error.hpp> |
| 40 | -#include <srs_app_st_socket.hpp> | 40 | +#include <srs_app_st.hpp> |
| 41 | #include <srs_core_autofree.hpp> | 41 | #include <srs_core_autofree.hpp> |
| 42 | #include <srs_app_config.hpp> | 42 | #include <srs_app_config.hpp> |
| 43 | #include <srs_kernel_utility.hpp> | 43 | #include <srs_kernel_utility.hpp> |
| @@ -30,7 +30,7 @@ using namespace std; | @@ -30,7 +30,7 @@ using namespace std; | ||
| 30 | 30 | ||
| 31 | #include <srs_kernel_error.hpp> | 31 | #include <srs_kernel_error.hpp> |
| 32 | #include <srs_rtmp_stack.hpp> | 32 | #include <srs_rtmp_stack.hpp> |
| 33 | -#include <srs_app_st_socket.hpp> | 33 | +#include <srs_app_st.hpp> |
| 34 | #include <srs_app_json.hpp> | 34 | #include <srs_app_json.hpp> |
| 35 | #include <srs_app_dvr.hpp> | 35 | #include <srs_app_dvr.hpp> |
| 36 | #include <srs_app_http_client.hpp> | 36 | #include <srs_app_http_client.hpp> |
| @@ -43,7 +43,7 @@ using namespace std; | @@ -43,7 +43,7 @@ using namespace std; | ||
| 43 | #include <srs_core_autofree.hpp> | 43 | #include <srs_core_autofree.hpp> |
| 44 | #include <srs_kernel_utility.hpp> | 44 | #include <srs_kernel_utility.hpp> |
| 45 | #include <srs_rtmp_stack.hpp> | 45 | #include <srs_rtmp_stack.hpp> |
| 46 | -#include <srs_app_st_socket.hpp> | 46 | +#include <srs_app_st.hpp> |
| 47 | #include <srs_rtmp_utility.hpp> | 47 | #include <srs_rtmp_utility.hpp> |
| 48 | #include <srs_app_utility.hpp> | 48 | #include <srs_app_utility.hpp> |
| 49 | #include <srs_rtmp_amf0.hpp> | 49 | #include <srs_rtmp_amf0.hpp> |
| @@ -42,7 +42,7 @@ using namespace std; | @@ -42,7 +42,7 @@ using namespace std; | ||
| 42 | #include <srs_app_refer.hpp> | 42 | #include <srs_app_refer.hpp> |
| 43 | #include <srs_app_hls.hpp> | 43 | #include <srs_app_hls.hpp> |
| 44 | #include <srs_app_bandwidth.hpp> | 44 | #include <srs_app_bandwidth.hpp> |
| 45 | -#include <srs_app_st_socket.hpp> | 45 | +#include <srs_app_st.hpp> |
| 46 | #include <srs_app_http_hooks.hpp> | 46 | #include <srs_app_http_hooks.hpp> |
| 47 | #include <srs_app_edge.hpp> | 47 | #include <srs_app_edge.hpp> |
| 48 | #include <srs_app_utility.hpp> | 48 | #include <srs_app_utility.hpp> |
| @@ -29,7 +29,7 @@ using namespace std; | @@ -29,7 +29,7 @@ using namespace std; | ||
| 29 | #include <srs_app_config.hpp> | 29 | #include <srs_app_config.hpp> |
| 30 | #include <srs_kernel_error.hpp> | 30 | #include <srs_kernel_error.hpp> |
| 31 | #include <srs_rtsp_stack.hpp> | 31 | #include <srs_rtsp_stack.hpp> |
| 32 | -#include <srs_app_st_socket.hpp> | 32 | +#include <srs_app_st.hpp> |
| 33 | #include <srs_kernel_log.hpp> | 33 | #include <srs_kernel_log.hpp> |
| 34 | #include <srs_app_utility.hpp> | 34 | #include <srs_app_utility.hpp> |
| 35 | #include <srs_core_autofree.hpp> | 35 | #include <srs_core_autofree.hpp> |
| @@ -26,6 +26,162 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -26,6 +26,162 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 26 | #include <srs_kernel_error.hpp> | 26 | #include <srs_kernel_error.hpp> |
| 27 | #include <srs_kernel_log.hpp> | 27 | #include <srs_kernel_log.hpp> |
| 28 | 28 | ||
| 29 | +SrsStSocket::SrsStSocket(st_netfd_t client_stfd) | ||
| 30 | +{ | ||
| 31 | + stfd = client_stfd; | ||
| 32 | + send_timeout = recv_timeout = ST_UTIME_NO_TIMEOUT; | ||
| 33 | + recv_bytes = send_bytes = 0; | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +SrsStSocket::~SrsStSocket() | ||
| 37 | +{ | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +bool SrsStSocket::is_never_timeout(int64_t timeout_us) | ||
| 41 | +{ | ||
| 42 | + return timeout_us == (int64_t)ST_UTIME_NO_TIMEOUT; | ||
| 43 | +} | ||
| 44 | + | ||
| 45 | +void SrsStSocket::set_recv_timeout(int64_t timeout_us) | ||
| 46 | +{ | ||
| 47 | + recv_timeout = timeout_us; | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | +int64_t SrsStSocket::get_recv_timeout() | ||
| 51 | +{ | ||
| 52 | + return recv_timeout; | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | +void SrsStSocket::set_send_timeout(int64_t timeout_us) | ||
| 56 | +{ | ||
| 57 | + send_timeout = timeout_us; | ||
| 58 | +} | ||
| 59 | + | ||
| 60 | +int64_t SrsStSocket::get_send_timeout() | ||
| 61 | +{ | ||
| 62 | + return send_timeout; | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +int64_t SrsStSocket::get_recv_bytes() | ||
| 66 | +{ | ||
| 67 | + return recv_bytes; | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +int64_t SrsStSocket::get_send_bytes() | ||
| 71 | +{ | ||
| 72 | + return send_bytes; | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | +int SrsStSocket::read(void* buf, size_t size, ssize_t* nread) | ||
| 76 | +{ | ||
| 77 | + int ret = ERROR_SUCCESS; | ||
| 78 | + | ||
| 79 | + ssize_t nb_read = st_read(stfd, buf, size, recv_timeout); | ||
| 80 | + if (nread) { | ||
| 81 | + *nread = nb_read; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + // On success a non-negative integer indicating the number of bytes actually read is returned | ||
| 85 | + // (a value of 0 means the network connection is closed or end of file is reached). | ||
| 86 | + // Otherwise, a value of -1 is returned and errno is set to indicate the error. | ||
| 87 | + if (nb_read <= 0) { | ||
| 88 | + // @see https://github.com/simple-rtmp-server/srs/issues/200 | ||
| 89 | + if (nb_read < 0 && errno == ETIME) { | ||
| 90 | + return ERROR_SOCKET_TIMEOUT; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + if (nb_read == 0) { | ||
| 94 | + errno = ECONNRESET; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + return ERROR_SOCKET_READ; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + recv_bytes += nb_read; | ||
| 101 | + | ||
| 102 | + return ret; | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +int SrsStSocket::read_fully(void* buf, size_t size, ssize_t* nread) | ||
| 106 | +{ | ||
| 107 | + int ret = ERROR_SUCCESS; | ||
| 108 | + | ||
| 109 | + ssize_t nb_read = st_read_fully(stfd, buf, size, recv_timeout); | ||
| 110 | + if (nread) { | ||
| 111 | + *nread = nb_read; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + // On success a non-negative integer indicating the number of bytes actually read is returned | ||
| 115 | + // (a value less than nbyte means the network connection is closed or end of file is reached) | ||
| 116 | + // Otherwise, a value of -1 is returned and errno is set to indicate the error. | ||
| 117 | + if (nb_read != (ssize_t)size) { | ||
| 118 | + // @see https://github.com/simple-rtmp-server/srs/issues/200 | ||
| 119 | + if (nb_read < 0 && errno == ETIME) { | ||
| 120 | + return ERROR_SOCKET_TIMEOUT; | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + if (nb_read >= 0) { | ||
| 124 | + errno = ECONNRESET; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + return ERROR_SOCKET_READ_FULLY; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + recv_bytes += nb_read; | ||
| 131 | + | ||
| 132 | + return ret; | ||
| 133 | +} | ||
| 134 | + | ||
| 135 | +int SrsStSocket::write(void* buf, size_t size, ssize_t* nwrite) | ||
| 136 | +{ | ||
| 137 | + int ret = ERROR_SUCCESS; | ||
| 138 | + | ||
| 139 | + ssize_t nb_write = st_write(stfd, buf, size, send_timeout); | ||
| 140 | + if (nwrite) { | ||
| 141 | + *nwrite = nb_write; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + // On success a non-negative integer equal to nbyte is returned. | ||
| 145 | + // Otherwise, a value of -1 is returned and errno is set to indicate the error. | ||
| 146 | + if (nb_write <= 0) { | ||
| 147 | + // @see https://github.com/simple-rtmp-server/srs/issues/200 | ||
| 148 | + if (nb_write < 0 && errno == ETIME) { | ||
| 149 | + return ERROR_SOCKET_TIMEOUT; | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + return ERROR_SOCKET_WRITE; | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + send_bytes += nb_write; | ||
| 156 | + | ||
| 157 | + return ret; | ||
| 158 | +} | ||
| 159 | + | ||
| 160 | +int SrsStSocket::writev(const iovec *iov, int iov_size, ssize_t* nwrite) | ||
| 161 | +{ | ||
| 162 | + int ret = ERROR_SUCCESS; | ||
| 163 | + | ||
| 164 | + ssize_t nb_write = st_writev(stfd, iov, iov_size, send_timeout); | ||
| 165 | + if (nwrite) { | ||
| 166 | + *nwrite = nb_write; | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + // On success a non-negative integer equal to nbyte is returned. | ||
| 170 | + // Otherwise, a value of -1 is returned and errno is set to indicate the error. | ||
| 171 | + if (nb_write <= 0) { | ||
| 172 | + // @see https://github.com/simple-rtmp-server/srs/issues/200 | ||
| 173 | + if (nb_write < 0 && errno == ETIME) { | ||
| 174 | + return ERROR_SOCKET_TIMEOUT; | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + return ERROR_SOCKET_WRITE; | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + send_bytes += nb_write; | ||
| 181 | + | ||
| 182 | + return ret; | ||
| 183 | +} | ||
| 184 | + | ||
| 29 | #ifdef __linux__ | 185 | #ifdef __linux__ |
| 30 | #include <sys/epoll.h> | 186 | #include <sys/epoll.h> |
| 31 | 187 |
| @@ -32,6 +32,45 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -32,6 +32,45 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 32 | 32 | ||
| 33 | #include <st.h> | 33 | #include <st.h> |
| 34 | 34 | ||
| 35 | +#include <srs_app_st.hpp> | ||
| 36 | +#include <srs_rtmp_io.hpp> | ||
| 37 | + | ||
| 38 | +/** | ||
| 39 | + * the socket provides TCP socket over st, | ||
| 40 | + * that is, the sync socket mechanism. | ||
| 41 | + */ | ||
| 42 | +class SrsStSocket : public ISrsProtocolReaderWriter | ||
| 43 | +{ | ||
| 44 | +private: | ||
| 45 | + int64_t recv_timeout; | ||
| 46 | + int64_t send_timeout; | ||
| 47 | + int64_t recv_bytes; | ||
| 48 | + int64_t send_bytes; | ||
| 49 | + st_netfd_t stfd; | ||
| 50 | +public: | ||
| 51 | + SrsStSocket(st_netfd_t client_stfd); | ||
| 52 | + virtual ~SrsStSocket(); | ||
| 53 | +public: | ||
| 54 | + virtual bool is_never_timeout(int64_t timeout_us); | ||
| 55 | + virtual void set_recv_timeout(int64_t timeout_us); | ||
| 56 | + virtual int64_t get_recv_timeout(); | ||
| 57 | + virtual void set_send_timeout(int64_t timeout_us); | ||
| 58 | + virtual int64_t get_send_timeout(); | ||
| 59 | + virtual int64_t get_recv_bytes(); | ||
| 60 | + virtual int64_t get_send_bytes(); | ||
| 61 | +public: | ||
| 62 | + /** | ||
| 63 | + * @param nread, the actual read bytes, ignore if NULL. | ||
| 64 | + */ | ||
| 65 | + virtual int read(void* buf, size_t size, ssize_t* nread); | ||
| 66 | + virtual int read_fully(void* buf, size_t size, ssize_t* nread); | ||
| 67 | + /** | ||
| 68 | + * @param nwrite, the actual write bytes, ignore if NULL. | ||
| 69 | + */ | ||
| 70 | + virtual int write(void* buf, size_t size, ssize_t* nwrite); | ||
| 71 | + virtual int writev(const iovec *iov, int iov_size, ssize_t* nwrite); | ||
| 72 | +}; | ||
| 73 | + | ||
| 35 | // initialize st, requires epoll. | 74 | // initialize st, requires epoll. |
| 36 | extern int srs_st_init(); | 75 | extern int srs_st_init(); |
| 37 | 76 |
trunk/src/app/srs_app_st_socket.cpp
已删除
100644 → 0
| 1 | -/* | ||
| 2 | -The MIT License (MIT) | ||
| 3 | - | ||
| 4 | -Copyright (c) 2013-2015 SRS(simple-rtmp-server) | ||
| 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_app_st_socket.hpp> | ||
| 25 | - | ||
| 26 | -#include <srs_kernel_error.hpp> | ||
| 27 | - | ||
| 28 | -SrsStSocket::SrsStSocket(st_netfd_t client_stfd) | ||
| 29 | -{ | ||
| 30 | - stfd = client_stfd; | ||
| 31 | - send_timeout = recv_timeout = ST_UTIME_NO_TIMEOUT; | ||
| 32 | - recv_bytes = send_bytes = 0; | ||
| 33 | -} | ||
| 34 | - | ||
| 35 | -SrsStSocket::~SrsStSocket() | ||
| 36 | -{ | ||
| 37 | -} | ||
| 38 | - | ||
| 39 | -bool SrsStSocket::is_never_timeout(int64_t timeout_us) | ||
| 40 | -{ | ||
| 41 | - return timeout_us == (int64_t)ST_UTIME_NO_TIMEOUT; | ||
| 42 | -} | ||
| 43 | - | ||
| 44 | -void SrsStSocket::set_recv_timeout(int64_t timeout_us) | ||
| 45 | -{ | ||
| 46 | - recv_timeout = timeout_us; | ||
| 47 | -} | ||
| 48 | - | ||
| 49 | -int64_t SrsStSocket::get_recv_timeout() | ||
| 50 | -{ | ||
| 51 | - return recv_timeout; | ||
| 52 | -} | ||
| 53 | - | ||
| 54 | -void SrsStSocket::set_send_timeout(int64_t timeout_us) | ||
| 55 | -{ | ||
| 56 | - send_timeout = timeout_us; | ||
| 57 | -} | ||
| 58 | - | ||
| 59 | -int64_t SrsStSocket::get_send_timeout() | ||
| 60 | -{ | ||
| 61 | - return send_timeout; | ||
| 62 | -} | ||
| 63 | - | ||
| 64 | -int64_t SrsStSocket::get_recv_bytes() | ||
| 65 | -{ | ||
| 66 | - return recv_bytes; | ||
| 67 | -} | ||
| 68 | - | ||
| 69 | -int64_t SrsStSocket::get_send_bytes() | ||
| 70 | -{ | ||
| 71 | - return send_bytes; | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -int SrsStSocket::read(void* buf, size_t size, ssize_t* nread) | ||
| 75 | -{ | ||
| 76 | - int ret = ERROR_SUCCESS; | ||
| 77 | - | ||
| 78 | - ssize_t nb_read = st_read(stfd, buf, size, recv_timeout); | ||
| 79 | - if (nread) { | ||
| 80 | - *nread = nb_read; | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - // On success a non-negative integer indicating the number of bytes actually read is returned | ||
| 84 | - // (a value of 0 means the network connection is closed or end of file is reached). | ||
| 85 | - // Otherwise, a value of -1 is returned and errno is set to indicate the error. | ||
| 86 | - if (nb_read <= 0) { | ||
| 87 | - // @see https://github.com/simple-rtmp-server/srs/issues/200 | ||
| 88 | - if (nb_read < 0 && errno == ETIME) { | ||
| 89 | - return ERROR_SOCKET_TIMEOUT; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - if (nb_read == 0) { | ||
| 93 | - errno = ECONNRESET; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - return ERROR_SOCKET_READ; | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - recv_bytes += nb_read; | ||
| 100 | - | ||
| 101 | - return ret; | ||
| 102 | -} | ||
| 103 | - | ||
| 104 | -int SrsStSocket::read_fully(void* buf, size_t size, ssize_t* nread) | ||
| 105 | -{ | ||
| 106 | - int ret = ERROR_SUCCESS; | ||
| 107 | - | ||
| 108 | - ssize_t nb_read = st_read_fully(stfd, buf, size, recv_timeout); | ||
| 109 | - if (nread) { | ||
| 110 | - *nread = nb_read; | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - // On success a non-negative integer indicating the number of bytes actually read is returned | ||
| 114 | - // (a value less than nbyte means the network connection is closed or end of file is reached) | ||
| 115 | - // Otherwise, a value of -1 is returned and errno is set to indicate the error. | ||
| 116 | - if (nb_read != (ssize_t)size) { | ||
| 117 | - // @see https://github.com/simple-rtmp-server/srs/issues/200 | ||
| 118 | - if (nb_read < 0 && errno == ETIME) { | ||
| 119 | - return ERROR_SOCKET_TIMEOUT; | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - if (nb_read >= 0) { | ||
| 123 | - errno = ECONNRESET; | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - return ERROR_SOCKET_READ_FULLY; | ||
| 127 | - } | ||
| 128 | - | ||
| 129 | - recv_bytes += nb_read; | ||
| 130 | - | ||
| 131 | - return ret; | ||
| 132 | -} | ||
| 133 | - | ||
| 134 | -int SrsStSocket::write(void* buf, size_t size, ssize_t* nwrite) | ||
| 135 | -{ | ||
| 136 | - int ret = ERROR_SUCCESS; | ||
| 137 | - | ||
| 138 | - ssize_t nb_write = st_write(stfd, buf, size, send_timeout); | ||
| 139 | - if (nwrite) { | ||
| 140 | - *nwrite = nb_write; | ||
| 141 | - } | ||
| 142 | - | ||
| 143 | - // On success a non-negative integer equal to nbyte is returned. | ||
| 144 | - // Otherwise, a value of -1 is returned and errno is set to indicate the error. | ||
| 145 | - if (nb_write <= 0) { | ||
| 146 | - // @see https://github.com/simple-rtmp-server/srs/issues/200 | ||
| 147 | - if (nb_write < 0 && errno == ETIME) { | ||
| 148 | - return ERROR_SOCKET_TIMEOUT; | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - return ERROR_SOCKET_WRITE; | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - send_bytes += nb_write; | ||
| 155 | - | ||
| 156 | - return ret; | ||
| 157 | -} | ||
| 158 | - | ||
| 159 | -int SrsStSocket::writev(const iovec *iov, int iov_size, ssize_t* nwrite) | ||
| 160 | -{ | ||
| 161 | - int ret = ERROR_SUCCESS; | ||
| 162 | - | ||
| 163 | - ssize_t nb_write = st_writev(stfd, iov, iov_size, send_timeout); | ||
| 164 | - if (nwrite) { | ||
| 165 | - *nwrite = nb_write; | ||
| 166 | - } | ||
| 167 | - | ||
| 168 | - // On success a non-negative integer equal to nbyte is returned. | ||
| 169 | - // Otherwise, a value of -1 is returned and errno is set to indicate the error. | ||
| 170 | - if (nb_write <= 0) { | ||
| 171 | - // @see https://github.com/simple-rtmp-server/srs/issues/200 | ||
| 172 | - if (nb_write < 0 && errno == ETIME) { | ||
| 173 | - return ERROR_SOCKET_TIMEOUT; | ||
| 174 | - } | ||
| 175 | - | ||
| 176 | - return ERROR_SOCKET_WRITE; | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - send_bytes += nb_write; | ||
| 180 | - | ||
| 181 | - return ret; | ||
| 182 | -} | ||
| 183 | - | ||
| 184 | - |
trunk/src/app/srs_app_st_socket.hpp
已删除
100644 → 0
| 1 | -/* | ||
| 2 | -The MIT License (MIT) | ||
| 3 | - | ||
| 4 | -Copyright (c) 2013-2015 SRS(simple-rtmp-server) | ||
| 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_APP_ST_SOCKET_HPP | ||
| 25 | -#define SRS_APP_ST_SOCKET_HPP | ||
| 26 | - | ||
| 27 | -/* | ||
| 28 | -#include <srs_app_st_socket.hpp> | ||
| 29 | -*/ | ||
| 30 | - | ||
| 31 | -#include <srs_core.hpp> | ||
| 32 | - | ||
| 33 | -#include <srs_app_st.hpp> | ||
| 34 | -#include <srs_rtmp_io.hpp> | ||
| 35 | - | ||
| 36 | -/** | ||
| 37 | -* the socket provides TCP socket over st, | ||
| 38 | -* that is, the sync socket mechanism. | ||
| 39 | -*/ | ||
| 40 | -class SrsStSocket : public ISrsProtocolReaderWriter | ||
| 41 | -{ | ||
| 42 | -private: | ||
| 43 | - int64_t recv_timeout; | ||
| 44 | - int64_t send_timeout; | ||
| 45 | - int64_t recv_bytes; | ||
| 46 | - int64_t send_bytes; | ||
| 47 | - st_netfd_t stfd; | ||
| 48 | -public: | ||
| 49 | - SrsStSocket(st_netfd_t client_stfd); | ||
| 50 | - virtual ~SrsStSocket(); | ||
| 51 | -public: | ||
| 52 | - virtual bool is_never_timeout(int64_t timeout_us); | ||
| 53 | - virtual void set_recv_timeout(int64_t timeout_us); | ||
| 54 | - virtual int64_t get_recv_timeout(); | ||
| 55 | - virtual void set_send_timeout(int64_t timeout_us); | ||
| 56 | - virtual int64_t get_send_timeout(); | ||
| 57 | - virtual int64_t get_recv_bytes(); | ||
| 58 | - virtual int64_t get_send_bytes(); | ||
| 59 | -public: | ||
| 60 | - /** | ||
| 61 | - * @param nread, the actual read bytes, ignore if NULL. | ||
| 62 | - */ | ||
| 63 | - virtual int read(void* buf, size_t size, ssize_t* nread); | ||
| 64 | - virtual int read_fully(void* buf, size_t size, ssize_t* nread); | ||
| 65 | - /** | ||
| 66 | - * @param nwrite, the actual write bytes, ignore if NULL. | ||
| 67 | - */ | ||
| 68 | - virtual int write(void* buf, size_t size, ssize_t* nwrite); | ||
| 69 | - virtual int writev(const iovec *iov, int iov_size, ssize_t* nwrite); | ||
| 70 | -}; | ||
| 71 | - | ||
| 72 | -#endif |
| @@ -42,7 +42,7 @@ using namespace std; | @@ -42,7 +42,7 @@ using namespace std; | ||
| 42 | #include <srs_core_autofree.hpp> | 42 | #include <srs_core_autofree.hpp> |
| 43 | #include <srs_app_st.hpp> | 43 | #include <srs_app_st.hpp> |
| 44 | #include <srs_rtmp_utility.hpp> | 44 | #include <srs_rtmp_utility.hpp> |
| 45 | -#include <srs_app_st_socket.hpp> | 45 | +#include <srs_app_st.hpp> |
| 46 | #include <srs_app_utility.hpp> | 46 | #include <srs_app_utility.hpp> |
| 47 | #include <srs_rtmp_amf0.hpp> | 47 | #include <srs_rtmp_amf0.hpp> |
| 48 | #include <srs_raw_avc.hpp> | 48 | #include <srs_raw_avc.hpp> |
-
请 注册 或 登录 后发表评论