Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-05-26 18:21:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
14f0a2e046ea13da598d16e1972741a5cca36c49
14f0a2e0
1 parent
93c9c55f
for bug #88, add timeout for connect.
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
19 行增加
和
10 行删除
trunk/research/librtmp/srs_play.c
trunk/src/app/srs_app_edge.cpp
trunk/src/app/srs_app_forward.cpp
trunk/src/core/srs_core.hpp
trunk/research/librtmp/srs_play.c
查看文件 @
14f0a2e
...
...
@@ -38,15 +38,24 @@ int main(int argc, char** argv)
u_int32_t
timestamp
=
0
;
char
*
data
;
if
(
argc
<=
1
)
{
printf
(
"play stream on RTMP server
\n
"
"Usage: %s <rtmp_url>
\n
"
" rtmp_url RTMP stream url to play
\n
"
"For example:
\n
"
" %s rtmp://127.0.0.1:1935/live/livestream
\n
"
,
argv
[
0
]);
int
ret
=
1
;
exit
(
ret
);
return
ret
;
}
rtmp
=
srs_rtmp_create
(
argv
[
1
]);
printf
(
"suck rtmp stream like rtmpdump
\n
"
);
printf
(
"srs(simple-rtmp-server) client librtmp library.
\n
"
);
printf
(
"version: %d.%d.%d
\n
"
,
srs_version_major
(),
srs_version_minor
(),
srs_version_revision
());
if
(
argc
>
1
)
{
rtmp
=
srs_rtmp_create
(
argv
[
1
]);
}
else
{
rtmp
=
srs_rtmp_create
(
"rtmp://127.0.0.1:1935/live/livestream"
);
}
printf
(
"rtmp url: %s
\n
"
,
rtmp
);
if
(
srs_simple_handshake
(
rtmp
)
!=
0
)
{
printf
(
"simple handshake failed.
\n
"
);
...
...
trunk/src/app/srs_app_edge.cpp
查看文件 @
14f0a2e
...
...
@@ -324,7 +324,7 @@ int SrsEdgeIngester::connect_server()
addr
.
sin_port
=
htons
(
port
);
addr
.
sin_addr
.
s_addr
=
inet_addr
(
ip
.
c_str
());
if
(
st_connect
(
stfd
,
(
const
struct
sockaddr
*
)
&
addr
,
sizeof
(
sockaddr_in
),
S
T_UTIME_NO_TIMEOUT
)
==
-
1
){
if
(
st_connect
(
stfd
,
(
const
struct
sockaddr
*
)
&
addr
,
sizeof
(
sockaddr_in
),
S
RS_EDGE_INGESTER_TIMEOUT_US
)
==
-
1
){
ret
=
ERROR_ST_CONNECT
;
srs_error
(
"connect to server error. ip=%s, port=%d, ret=%d"
,
ip
.
c_str
(),
port
,
ret
);
return
ret
;
...
...
@@ -605,7 +605,7 @@ int SrsEdgeForwarder::connect_server()
addr
.
sin_port
=
htons
(
port
);
addr
.
sin_addr
.
s_addr
=
inet_addr
(
ip
.
c_str
());
if
(
st_connect
(
stfd
,
(
const
struct
sockaddr
*
)
&
addr
,
sizeof
(
sockaddr_in
),
S
T_UTIME_NO_TIMEOUT
)
==
-
1
){
if
(
st_connect
(
stfd
,
(
const
struct
sockaddr
*
)
&
addr
,
sizeof
(
sockaddr_in
),
S
RS_EDGE_FORWARDER_TIMEOUT_US
)
==
-
1
){
ret
=
ERROR_ST_CONNECT
;
srs_error
(
"connect to server error. ip=%s, port=%d, ret=%d"
,
ip
.
c_str
(),
port
,
ret
);
return
ret
;
...
...
trunk/src/app/srs_app_forward.cpp
查看文件 @
14f0a2e
...
...
@@ -298,7 +298,7 @@ int SrsForwarder::connect_server()
addr
.
sin_port
=
htons
(
port
);
addr
.
sin_addr
.
s_addr
=
inet_addr
(
ip
.
c_str
());
if
(
st_connect
(
stfd
,
(
const
struct
sockaddr
*
)
&
addr
,
sizeof
(
sockaddr_in
),
S
T_UTIME_NO_TIMEOUT
)
==
-
1
){
if
(
st_connect
(
stfd
,
(
const
struct
sockaddr
*
)
&
addr
,
sizeof
(
sockaddr_in
),
S
RS_FORWARDER_SLEEP_US
)
==
-
1
){
ret
=
ERROR_ST_CONNECT
;
srs_error
(
"connect to server error. ip=%s, port=%d, ret=%d"
,
ip
.
c_str
(),
port
,
ret
);
return
ret
;
...
...
trunk/src/core/srs_core.hpp
查看文件 @
14f0a2e
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "11
5
"
#define VERSION_REVISION "11
6
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
请
注册
或
登录
后发表评论