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/util/AtomicBoolean.h" 28 #if !defined(MSG_NOSIGNAL) 29 # define MSG_NOSIGNAL 0 32 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 34 #pragma warning(disable: 4251) //for dll export 35 #pragma warning(disable: 4003) //for not enough actual parameters for macro 'min' in asio wait_traits 45 class HAZELCAST_API SSLSocket :
public Socket {
51 std::string description;
57 SSLSocket(
const client::Address &address, asio::ssl::context &sslContext);
69 int connect(
int timeoutInMillis);
78 int send(
const void *buffer,
int len,
int flag = 0);
87 int receive(
void *buffer,
int len,
int flag = 0);
92 int getSocketId()
const;
100 client::Address getAddress()
const;
102 void setBlocking(
bool blocking);
107 std::vector<SSLSocket::CipherInfo> getCiphers()
const;
109 std::auto_ptr<Address> localSocketAddress()
const;
111 SSLSocket(
const Socket &rhs);
113 SSLSocket &operator=(
const Socket &rhs);
117 ReadHandler(
size_t &numRead, asio::error_code &ec);
119 void operator()(
const asio::error_code &err, std::size_t bytes_transferred);
121 size_t &getNumRead()
const;
123 asio::error_code &getErrorCode()
const;
127 asio::error_code &errorCode;
134 int handleError(
const std::string &source,
size_t numBytes,
const asio::error_code &error)
const;
136 void handleConnect(
const asio::error_code &error);
138 void checkDeadline(
const asio::error_code &ec);
140 client::Address remoteEndpoint;
142 asio::io_service ioService;
143 asio::ssl::context &sslContext;
144 std::auto_ptr<asio::ssl::stream<asio::ip::tcp::socket> > socket;
145 asio::deadline_timer deadline;
146 asio::error_code errorCode;
150 std::ostream &operator<<(std::ostream &out,
const SSLSocket::CipherInfo &info);
156 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) Definition: MapEntryView.h:32