mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine SrsTcpClient.timeout in time unit.
This commit is contained in:
parent
feb34ed225
commit
5505eceeac
3 changed files with 13 additions and 14 deletions
|
@ -54,8 +54,7 @@ SrsHttpClient::~SrsHttpClient()
|
|||
srs_freep(parser);
|
||||
}
|
||||
|
||||
// TODO: FIXME: use ms for timeout.
|
||||
srs_error_t SrsHttpClient::initialize(string h, int p, int64_t tm)
|
||||
srs_error_t SrsHttpClient::initialize(string h, int p, srs_utime_t tm)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -220,15 +219,15 @@ srs_error_t SrsHttpClient::connect()
|
|||
return err;
|
||||
}
|
||||
|
||||
transport = new SrsTcpClient(host, port, srs_utime_t(timeout * SRS_UTIME_MILLISECONDS));
|
||||
transport = new SrsTcpClient(host, port, timeout);
|
||||
if ((err = transport->connect()) != srs_success) {
|
||||
disconnect();
|
||||
return srs_error_wrap(err, "http: tcp connect %s:%d to=%d", host.c_str(), port, (int)timeout);
|
||||
return srs_error_wrap(err, "http: tcp connect %s:%d to=%dms", host.c_str(), port, srsu2msi(timeout));
|
||||
}
|
||||
|
||||
// Set the recv/send timeout in ms.
|
||||
transport->set_recv_timeout(timeout * SRS_UTIME_MILLISECONDS);
|
||||
transport->set_send_timeout(timeout * SRS_UTIME_MILLISECONDS);
|
||||
// Set the recv/send timeout in srs_utime_t.
|
||||
transport->set_recv_timeout(timeout);
|
||||
transport->set_send_timeout(timeout);
|
||||
|
||||
kbps->set_io(transport, transport);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue