From 03530311b8ce1cc7e19703df58efc67ba93015fc Mon Sep 17 00:00:00 2001 From: aleks-f Date: Tue, 26 Feb 2013 22:39:17 -0600 Subject: [PATCH] GH71: WebSocket and broken Timeouts fixed GH# 71: WebSocket and broken Timeouts (POCO_BROKEN_TIMEOUTS) --- CHANGELOG | 1 + Net/include/Poco/Net/WebSocketImpl.h | 4 ++++ Net/src/WebSocketImpl.cpp | 26 +++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 824f383d1..eb15d8b71 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ Release 1.5.2 (2013-03-??) - merged GH #86: Invalid pointers to vector internals (by Adrian Imboden) - automatic library initialization macros - fixed GH #110: WebSocket accept() fails when Connection header contains multiple tokens +- fixed GH# 71: WebSocket and broken Timeouts (POCO_BROKEN_TIMEOUTS) Release 1.5.1 (2013-01-11) ========================== diff --git a/Net/include/Poco/Net/WebSocketImpl.h b/Net/include/Poco/Net/WebSocketImpl.h index 439c3008c..6075fbb61 100644 --- a/Net/include/Poco/Net/WebSocketImpl.h +++ b/Net/include/Poco/Net/WebSocketImpl.h @@ -78,6 +78,10 @@ public: virtual int receiveFrom(void* buffer, int length, SocketAddress& address, int flags = 0); virtual void sendUrgent(unsigned char data); virtual bool secure() const; + virtual void setSendTimeout(const Poco::Timespan& timeout); + virtual Poco::Timespan getSendTimeout(); + virtual void setReceiveTimeout(const Poco::Timespan& timeout); + virtual Poco::Timespan getReceiveTimeout(); // Internal int frameFlags() const; diff --git a/Net/src/WebSocketImpl.cpp b/Net/src/WebSocketImpl.cpp index 1caf31074..5177ab2e7 100644 --- a/Net/src/WebSocketImpl.cpp +++ b/Net/src/WebSocketImpl.cpp @@ -297,5 +297,29 @@ bool WebSocketImpl::secure() const return _pStreamSocketImpl->secure(); } - + +void WebSocketImpl::setSendTimeout(const Poco::Timespan& timeout) +{ + _pStreamSocketImpl->setSendTimeout(timeout); +} + + +Poco::Timespan WebSocketImpl::getSendTimeout() +{ + return _pStreamSocketImpl->getSendTimeout(); +} + + +void WebSocketImpl::setReceiveTimeout(const Poco::Timespan& timeout) +{ + _pStreamSocketImpl->setReceiveTimeout(timeout); +} + + +Poco::Timespan WebSocketImpl::getReceiveTimeout() +{ + return _pStreamSocketImpl->getReceiveTimeout(); +} + + } } // namespace Poco::Net