mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine set_recv_timeout in time unit
This commit is contained in:
parent
38bbf6b111
commit
d3dc45f357
20 changed files with 45 additions and 46 deletions
|
@ -186,7 +186,7 @@ srs_error_t SrsHttpClient::get(string path, string req, ISrsHttpMessage** ppmsg)
|
|||
return err;
|
||||
}
|
||||
|
||||
void SrsHttpClient::set_recv_timeout(int64_t tm)
|
||||
void SrsHttpClient::set_recv_timeout(srs_utime_t tm)
|
||||
{
|
||||
transport->set_recv_timeout(tm);
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ srs_error_t SrsHttpClient::connect()
|
|||
}
|
||||
|
||||
// Set the recv/send timeout in ms.
|
||||
transport->set_recv_timeout(timeout);
|
||||
transport->set_recv_timeout(timeout * SRS_UTIME_MILLISECONDS);
|
||||
transport->set_send_timeout(timeout * SRS_UTIME_MILLISECONDS);
|
||||
|
||||
kbps->set_io(transport, transport);
|
||||
|
|
|
@ -101,7 +101,7 @@ public:
|
|||
*/
|
||||
virtual srs_error_t get(std::string path, std::string req, ISrsHttpMessage** ppmsg);
|
||||
private:
|
||||
virtual void set_recv_timeout(int64_t tm);
|
||||
virtual void set_recv_timeout(srs_utime_t tm);
|
||||
public:
|
||||
virtual void kbps_sample(const char* label, int64_t age);
|
||||
private:
|
||||
|
|
|
@ -74,7 +74,7 @@ srs_error_t SrsBasicRtmpClient::connect()
|
|||
return srs_error_wrap(err, "connect");
|
||||
}
|
||||
|
||||
client->set_recv_timeout(stream_timeout);
|
||||
client->set_recv_timeout(stream_timeout * SRS_UTIME_MILLISECONDS);
|
||||
client->set_send_timeout(stream_timeout * SRS_UTIME_MILLISECONDS);
|
||||
|
||||
// connect to vhost/app
|
||||
|
@ -234,7 +234,7 @@ srs_error_t SrsBasicRtmpClient::send_and_free_message(SrsSharedPtrMessage* msg)
|
|||
return client->send_and_free_message(msg, stream_id);
|
||||
}
|
||||
|
||||
void SrsBasicRtmpClient::set_recv_timeout(int64_t timeout)
|
||||
void SrsBasicRtmpClient::set_recv_timeout(srs_utime_t timeout)
|
||||
{
|
||||
transport->set_recv_timeout(timeout);
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
virtual srs_error_t send_and_free_messages(SrsSharedPtrMessage** msgs, int nb_msgs);
|
||||
virtual srs_error_t send_and_free_message(SrsSharedPtrMessage* msg);
|
||||
public:
|
||||
virtual void set_recv_timeout(int64_t timeout);
|
||||
virtual void set_recv_timeout(srs_utime_t timeout);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -251,7 +251,7 @@ bool SrsStSocket::is_never_timeout(int64_t tm)
|
|||
return tm == SRS_UTIME_NO_TIMEOUT;
|
||||
}
|
||||
|
||||
void SrsStSocket::set_recv_timeout(int64_t tm)
|
||||
void SrsStSocket::set_recv_timeout(srs_utime_t tm)
|
||||
{
|
||||
rtm = tm;
|
||||
}
|
||||
|
@ -465,7 +465,7 @@ bool SrsTcpClient::is_never_timeout(int64_t tm)
|
|||
return io->is_never_timeout(tm);
|
||||
}
|
||||
|
||||
void SrsTcpClient::set_recv_timeout(int64_t tm)
|
||||
void SrsTcpClient::set_recv_timeout(srs_utime_t tm)
|
||||
{
|
||||
io->set_recv_timeout(tm);
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ public:
|
|||
virtual srs_error_t initialize(srs_netfd_t fd);
|
||||
public:
|
||||
virtual bool is_never_timeout(int64_t tm);
|
||||
virtual void set_recv_timeout(int64_t tm);
|
||||
virtual void set_recv_timeout(srs_utime_t tm);
|
||||
virtual int64_t get_recv_timeout();
|
||||
virtual void set_send_timeout(srs_utime_t tm);
|
||||
virtual srs_utime_t get_send_timeout();
|
||||
|
@ -189,7 +189,7 @@ private:
|
|||
// interface ISrsProtocolReadWriter
|
||||
public:
|
||||
virtual bool is_never_timeout(int64_t tm);
|
||||
virtual void set_recv_timeout(int64_t tm);
|
||||
virtual void set_recv_timeout(srs_utime_t tm);
|
||||
virtual int64_t get_recv_timeout();
|
||||
virtual void set_send_timeout(srs_utime_t tm);
|
||||
virtual srs_utime_t get_send_timeout();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue