// ********************************************************************** // // Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef ICE_CONNECT_REQUEST_HANDLER_H #define ICE_CONNECT_REQUEST_HANDLER_H #include #include #include #include #include #include #include #include #include #include namespace IceInternal { class ConnectRequestHandler : public RequestHandler, public Reference::GetConnectionCallback, public RouterInfo::AddProxyCallback, public IceUtil::Monitor, public Ice::EnableSharedFromThis { public: ConnectRequestHandler(const ReferencePtr&, const Ice::ObjectPrxPtr&); RequestHandlerPtr connect(const Ice::ObjectPrxPtr&); virtual RequestHandlerPtr update(const RequestHandlerPtr&, const RequestHandlerPtr&); virtual bool sendRequest(ProxyOutgoingBase*); virtual AsyncStatus sendAsyncRequest(const ProxyOutgoingAsyncBasePtr&); virtual void requestCanceled(OutgoingBase*, const Ice::LocalException&); virtual void asyncRequestCanceled(const OutgoingAsyncBasePtr&, const Ice::LocalException&); virtual Ice::ConnectionIPtr getConnection(); virtual Ice::ConnectionIPtr waitForConnection(); virtual void setConnection(const Ice::ConnectionIPtr&, bool); virtual void setException(const Ice::LocalException&); virtual void addedProxy(); using Ice::EnableSharedFromThis::shared_from_this; private: bool initialized(); void flushRequests(); struct Request { Request() : out(0) { } ProxyOutgoingBase* out; ProxyOutgoingAsyncBasePtr outAsync; }; Ice::ObjectPrxPtr _proxy; std::set _proxies; Ice::ConnectionIPtr _connection; bool _compress; #ifdef ICE_CPP11_MAPPING std::exception_ptr _exception; #else IceUtil::UniquePtr _exception; #endif bool _initialized; bool _flushing; std::deque _requests; RequestHandlerPtr _requestHandler; }; } #endif