Skip to content

Commit

Permalink
add separate accessors and mutators for connect, send and receive tim… (
Browse files Browse the repository at this point in the history
#3476)

* add separate accessors and mutators for connect, send and receive timeouts

* implement timeout methods outside of class declaration to conform to existing code structure

* Update HTTPSession.h

Co-authored-by: bfoster <bfoster@malwarebytes.com>
Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 28, 2022
1 parent 168f1eb commit cc14bcf
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Net/include/Poco/Net/HTTPSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ class Net_API HTTPSession
Poco::Timespan getTimeout() const;
/// Returns the timeout for the HTTP session.

void setConnectTimeout(const Poco::Timespan& timeout);
/// Sets the connect timeout.

Poco::Timespan getConnectTimeout() const;
/// Gets the connect timeout.

void setSendTimeout(const Poco::Timespan& timeout);
/// Sets the send timeout.

Poco::Timespan getSendTimeout() const;
/// Gets the send timeout.

void setReceiveTimeout(const Poco::Timespan& timeout);
/// Sets the receive timeout.

Poco::Timespan getReceiveTimeout() const;
/// Gets the receive timeout.

bool connected() const;
/// Returns true if the underlying socket is connected.

Expand Down Expand Up @@ -225,6 +243,42 @@ inline Poco::Timespan HTTPSession::getTimeout() const
}


inline void HTTPSession::setConnectTimeout(const Poco::Timespan& timeout)
{
_connectionTimeout = timeout;
}


inline Poco::Timespan HTTPSession::getConnectTimeout() const
{
return _connectionTimeout;
}


inline void HTTPSession::setSendTimeout(const Poco::Timespan& timeout)
{
_sendTimeout = timeout;
}


inline Poco::Timespan HTTPSession::getSendTimeout() const
{
return _sendTimeout;
}


inline void HTTPSession::setReceiveTimeout(const Poco::Timespan& timeout)
{
_receiveTimeout = timeout;
}


inline Poco::Timespan HTTPSession::getReceiveTimeout() const
{
return _receiveTimeout;
}


inline StreamSocket& HTTPSession::socket()
{
return _socket;
Expand Down

0 comments on commit cc14bcf

Please sign in to comment.