mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for bug #88, add timeout for connect.
This commit is contained in:
parent
93c9c55fb9
commit
14f0a2e046
4 changed files with 19 additions and 10 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue