forked from zeromq/libzmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwss_engine.hpp
42 lines (33 loc) · 940 Bytes
/
wss_engine.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_WSS_ENGINE_HPP_INCLUDED__
#define __ZMQ_WSS_ENGINE_HPP_INCLUDED__
#include <gnutls/gnutls.h>
#include "ws_engine.hpp"
#define WSS_BUFFER_SIZE 8192
namespace zmq
{
class wss_engine_t : public ws_engine_t
{
public:
wss_engine_t (fd_t fd_,
const options_t &options_,
const endpoint_uri_pair_t &endpoint_uri_pair_,
ws_address_t &address_,
bool client_,
void *tls_server_cred_,
const std::string &hostname_);
~wss_engine_t ();
void out_event ();
protected:
bool handshake ();
void plug_internal ();
int read (void *data, size_t size_);
int write (const void *data_, size_t size_);
private:
bool do_handshake ();
bool _established;
gnutls_certificate_credentials_t _tls_client_cred;
gnutls_session_t _tls_session;
};
}
#endif