diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-11-27 11:58:35 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-11-27 11:58:35 +0100 |
commit | 47f800495093fd7679a315e2d730fea22f6135b7 (patch) | |
tree | a7b8d3488f3841367dd03d10cae293f36fd10481 /cpp/src/Ice/ConnectRequestHandler.h | |
parent | Fixed SystemException to no longer derive from LocalException (diff) | |
download | ice-47f800495093fd7679a315e2d730fea22f6135b7.tar.bz2 ice-47f800495093fd7679a315e2d730fea22f6135b7.tar.xz ice-47f800495093fd7679a315e2d730fea22f6135b7.zip |
- Added support for non-blocking AMI/batch requests, connection
creation.
- Added support for AMI oneway requests.
- Changed collocation optimization to not perform any DNS lookups.
Diffstat (limited to 'cpp/src/Ice/ConnectRequestHandler.h')
-rw-r--r-- | cpp/src/Ice/ConnectRequestHandler.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/cpp/src/Ice/ConnectRequestHandler.h b/cpp/src/Ice/ConnectRequestHandler.h new file mode 100644 index 00000000000..bdf8d1b3a16 --- /dev/null +++ b/cpp/src/Ice/ConnectRequestHandler.h @@ -0,0 +1,88 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2007 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 <IceUtil/Monitor.h> +#include <IceUtil/Mutex.h> + +#include <Ice/RequestHandler.h> +#include <Ice/Reference.h> +#include <Ice/RouterInfo.h> +#include <Ice/ProxyF.h> +#include <Ice/BasicStream.h> + +namespace IceInternal +{ + +class ConnectRequestHandler : public RequestHandler, + public Reference::GetConnectionCallback, + public RouterInfo::AddProxyCallback, + public IceUtil::Monitor<IceUtil::Mutex> +{ +public: + + ConnectRequestHandler(const ReferencePtr&, const Ice::ObjectPrx&, const Handle< ::IceDelegate::Ice::Object>&); + virtual ~ConnectRequestHandler(); + + RequestHandlerPtr connect(); + + virtual void prepareBatchRequest(BasicStream*); + virtual void finishBatchRequest(BasicStream*); + virtual void abortBatchRequest(); + + virtual Ice::ConnectionI* sendRequest(Outgoing*); + virtual void sendAsyncRequest(const OutgoingAsyncPtr&); + + virtual bool flushBatchRequests(BatchOutgoing*); + virtual void flushAsyncBatchRequests(const BatchOutgoingAsyncPtr&); + + virtual Ice::ConnectionIPtr getConnection(bool); + + virtual void setConnection(const Ice::ConnectionIPtr&, bool); + virtual void setException(const Ice::LocalException&); + + virtual void addedProxy(); + +private: + + bool initialized(); + void flushRequests(); + + struct Request + { + OutgoingAsyncPtr out; + BatchOutgoingAsyncPtr batchOut; + BasicStream* os; + }; + + Ice::ObjectPrx _proxy; + Handle< ::IceDelegate::Ice::Object> _delegate; + + const bool _response; + const bool _batchAutoFlush; + + Ice::ConnectionIPtr _connection; + bool _compress; + std::auto_ptr<Ice::LocalException> _exception; + bool _initialized; + bool _flushing; + + std::vector<Request> _requests; + bool _batchRequestInProgress; + size_t _batchRequestsSize; + BasicStream _batchStream; + bool _updateRequestHandler; +}; +typedef IceUtil::Handle<ConnectRequestHandler> ConnectRequestHandlerPtr; + +} + +#endif |