diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-09-10 08:47:19 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-09-10 08:47:19 +0200 |
commit | b6c9d9a880f6f1a6908a3c62dfccdce3e68dad80 (patch) | |
tree | d3e9e9340064538a8dc7a645260d0eb3cdf55d63 /cpp/src/Ice/NetworkProxy.h | |
parent | Undo bogus change from an earlier commit. (diff) | |
download | ice-b6c9d9a880f6f1a6908a3c62dfccdce3e68dad80.tar.bz2 ice-b6c9d9a880f6f1a6908a3c62dfccdce3e68dad80.tar.xz ice-b6c9d9a880f6f1a6908a3c62dfccdce3e68dad80.zip |
ICE-5582 (SOCKs test), ICE-5314 (HTTP proxies), major refactoring of networking code (addition of StreamSocket class abstraction)
Diffstat (limited to 'cpp/src/Ice/NetworkProxy.h')
-rw-r--r-- | cpp/src/Ice/NetworkProxy.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/cpp/src/Ice/NetworkProxy.h b/cpp/src/Ice/NetworkProxy.h new file mode 100644 index 00000000000..c9b54f04d64 --- /dev/null +++ b/cpp/src/Ice/NetworkProxy.h @@ -0,0 +1,74 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2014 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_NETWORK_PROXY_H +#define ICE_NETWORK_PROXY_H + +#include <Ice/Network.h> + +namespace IceInternal +{ + +class ICE_API NetworkProxy : virtual public IceUtil::Shared +{ +public: + + // + // Write the connection request on the connection established + // with the network proxy server. This is called right after + // the connection establishment succeeds. + // + virtual void beginWrite(const Address&, Buffer&) = 0; + virtual SocketOperation endWrite(Buffer&) = 0; + + // + // Once the connection request has been sent, this is called + // to prepare and read the response from the proxy server. + // + virtual void beginRead(Buffer&) = 0; + virtual SocketOperation endRead(Buffer&) = 0; + + // + // This is called when the response from the proxy has been + // read. The proxy should copy the extra read data (if any) in the + // given byte vector. + // + virtual void finish(Buffer&, Buffer&) = 0; + + // + // If the proxy host needs to be resolved, this should return + // a new NetworkProxy containing the IP address of the proxy. + // This is called from the endpoint host resolver thread, so + // it's safe if this this method blocks. + // + virtual NetworkProxyPtr resolveHost(ProtocolSupport) const = 0; + + // + // Returns the IP address of the network proxy. This method + // must not block. It's only called on a network proxy object + // returned by resolveHost(). + // + virtual Address getAddress() const = 0; + + // + // Returns the name of the proxy, used for tracing purposes. + // + virtual std::string getName() const = 0; + + // + // Returns the protocols supported by the proxy. + // + virtual ProtocolSupport getProtocolSupport() const = 0; +}; + +NetworkProxyPtr createNetworkProxy(const Ice::PropertiesPtr&, ProtocolSupport); + +} + +#endif |