16 #ifndef HAZELCAST_CLIENT_INTERNAL_SOCKET_SSLSOCKET_H_ 17 #define HAZELCAST_CLIENT_INTERNAL_SOCKET_SSLSOCKET_H_ 19 #ifdef HZ_BUILD_WITH_SSL 22 #include <asio/ssl.hpp> 24 #include "hazelcast/client/Socket.h" 25 #include "hazelcast/client/Address.h" 26 #include "hazelcast/client/config/SocketOptions.h" 27 #include "hazelcast/util/AtomicBoolean.h" 29 #if !defined(MSG_NOSIGNAL) 30 # define MSG_NOSIGNAL 0 33 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 35 #pragma warning(disable: 4251) //for dll export 36 #pragma warning(disable: 4003) //for not enough actual parameters for macro 'min' in asio wait_traits 46 class HAZELCAST_API SSLSocket :
public Socket {
52 std::string description;
58 SSLSocket(
const client::Address &address, asio::ssl::context &sslContext,
59 client::config::SocketOptions &socketOptions);
71 int connect(
int timeoutInMillis);
80 int send(
const void *buffer,
int len,
int flag = 0);
89 int receive(
void *buffer,
int len,
int flag = 0);
94 int getSocketId()
const;
102 client::Address getAddress()
const;
104 void setBlocking(
bool blocking);
109 std::vector<SSLSocket::CipherInfo> getCiphers()
const;
111 std::auto_ptr<Address> localSocketAddress()
const;
114 SSLSocket(
const Socket &rhs);
116 SSLSocket &operator=(
const Socket &rhs);
120 ReadHandler(
size_t &numRead, asio::error_code &ec);
122 void operator()(
const asio::error_code &err, std::size_t bytes_transferred);
124 size_t &getNumRead()
const;
126 asio::error_code &getErrorCode()
const;
130 asio::error_code &errorCode;
137 int handleError(
const std::string &source,
size_t numBytes,
const asio::error_code &error)
const;
139 void handleConnect(
const asio::error_code &error);
141 void checkDeadline(
const asio::error_code &ec);
143 void setSocketOptions();
145 client::Address remoteEndpoint;
147 asio::io_service ioService;
148 asio::ssl::context &sslContext;
149 std::auto_ptr<asio::ssl::stream<asio::ip::tcp::socket> > socket;
150 asio::deadline_timer deadline;
151 asio::error_code errorCode;
153 const client::config::SocketOptions &socketOptions;
156 std::ostream &operator<<(std::ostream &out,
const SSLSocket::CipherInfo &info);
162 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32