mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine simple rtmp client for post flv stream.
This commit is contained in:
parent
adb8f243bf
commit
a9ad7b211b
3 changed files with 7 additions and 6 deletions
|
@ -92,7 +92,7 @@ SrsSimpleRtmpClient::~SrsSimpleRtmpClient()
|
|||
srs_freep(transport);
|
||||
}
|
||||
|
||||
int SrsSimpleRtmpClient::connect(string url)
|
||||
int SrsSimpleRtmpClient::connect(string url, int64_t timeout)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
|
@ -110,15 +110,15 @@ int SrsSimpleRtmpClient::connect(string url)
|
|||
}
|
||||
|
||||
// connect host.
|
||||
if ((ret = transport->connect(req->host, req->port, ST_UTIME_NO_TIMEOUT)) != ERROR_SUCCESS) {
|
||||
if ((ret = transport->connect(req->host, req->port, timeout)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
srs_freep(client);
|
||||
client = new SrsRtmpClient(transport);
|
||||
|
||||
client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US);
|
||||
client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US);
|
||||
client->set_recv_timeout(timeout);
|
||||
client->set_send_timeout(timeout);
|
||||
|
||||
// connect to vhost/app
|
||||
if ((ret = client->handshake()) != ERROR_SUCCESS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue