feat(SecureSocketImpl): how to set the socket of SecureSocketImpl to no-blocking? #2352

This commit is contained in:
Alex Fabijanic 2022-06-29 11:41:39 +02:00
parent 0d539a71f5
commit 5d7a1016c2
2 changed files with 25 additions and 0 deletions

View File

@ -161,6 +161,15 @@ public:
/// underlying TCP connection. No orderly SSL shutdown
/// is performed.
void setBlocking(bool flag);
/// Sets the socket in blocking mode if flag is true,
/// disables blocking mode if flag is false.
bool getBlocking() const;
/// Returns the blocking mode of the socket.
/// This method will only work if the blocking modes of
/// the socket are changed via the setBlocking method!
int sendBytes(const void* buffer, int length, int flags = 0);
/// Sends the contents of the given buffer through
/// the socket. Any specified flags are ignored.

View File

@ -311,6 +311,22 @@ void SecureSocketImpl::close()
}
void SecureSocketImpl::setBlocking(bool flag)
{
poco_check_ptr (_pSocket);
_pSocket->setBlocking(flag);
}
bool SecureSocketImpl::getBlocking() const
{
poco_check_ptr (_pSocket);
return _pSocket->getBlocking();
}
int SecureSocketImpl::sendBytes(const void* buffer, int length, int flags)
{
poco_assert (_pSocket->initialized());