From 2fe064b44b5d56c87b65e889bfe898ce2ee737fc Mon Sep 17 00:00:00 2001 From: Dwayne Boone Date: Tue, 3 Mar 2015 13:05:19 -0330 Subject: ICE-6116 reduce verbose warnings about socket buffer size --- cpp/src/Ice/Instance.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'cpp/src/Ice/Instance.h') diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index 176e5d731fc..a6e9182b136 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -63,6 +63,24 @@ typedef IceUtil::Handle MetricsAdminIPtr; class RequestHandlerFactory; typedef IceUtil::Handle RequestHandlerFactoryPtr; +// +// Structure to track warnings for attempts to set socket buffer sizes +// +struct BufSizeWarnInfo +{ + // Whether send size warning has been emitted + bool sndWarn; + + // The send size for which the warning wwas emitted + int sndSize; + + // Whether receive size warning has been emitted + bool rcvWarn; + + // The receive size for which the warning wwas emitted + int rcvSize; +}; + class Instance : public IceUtil::Shared, public IceUtil::Monitor { public: @@ -118,7 +136,11 @@ public: IceUtil::StringConverterPtr getStringConverter() const { return _stringConverter; } IceUtil::WstringConverterPtr getWstringConverter() const { return _wstringConverter; } - + + BufSizeWarnInfo getBufSizeWarn(Ice::Short type); + void setSndBufSizeWarn(Ice::Short type, int size); + void setRcvBufSizeWarn(Ice::Short type, int size); + private: Instance(const Ice::CommunicatorPtr&, const Ice::InitializationData&); @@ -134,6 +156,8 @@ private: void addAllAdminFacets(); void setServerProcessProxy(const Ice::ObjectAdapterPtr&, const Ice::Identity&); + BufSizeWarnInfo getBufSizeWarnInternal(Ice::Short type); + enum State { StateActive, @@ -177,6 +201,8 @@ private: Ice::Identity _adminIdentity; std::set _adminFacetFilter; IceInternal::MetricsAdminIPtr _metricsAdmin; + std::map _setBufSizeWarn; + IceUtil::Mutex _setBufSizeWarnMutex; }; class ProcessI : public Ice::Process -- cgit v1.2.3