libUTL++
SSLsocket.h
1
#pragma once
2
4
5
#include <libutl/InetHostAddress.h>
6
#include <libutl/Stream.h>
7
9
10
extern
"C"
{
11
struct
bio_st;
12
struct
ssl_st;
13
typedef
bio_st BIO;
14
typedef
ssl_st SSL;
15
}
16
18
19
UTL_NS_BEGIN;
20
22
30
32
class
SSLsocket
:
public
Stream
33
{
34
UTL_CLASS_DECL
(
SSLsocket
,
Stream
);
35
36
public
:
42
SSLsocket
(
const
InetHostAddress
& hostAddr,
uint16_t
port);
43
49
void
open(
const
InetHostAddress
& hostAddr,
uint16_t
port);
50
51
virtual
void
close();
52
57
bool
certificateOK()
const
;
58
59
virtual
size_t
read(
byte_t
* array,
size_t
maxBytes,
size_t
minBytes =
size_t_max
);
60
61
virtual
void
write(
const
byte_t
* array,
size_t
num);
62
63
private
:
64
void
65
init
()
66
{
67
_bio =
nullptr
;
68
}
69
void
70
deInit
()
71
{
72
close();
73
}
74
75
private
:
76
BIO* _bio;
77
};
78
80
81
UTL_NS_END;
utl::deInit
void deInit()
De-initialize UTL++.
UTL_CLASS_DECL
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
Definition:
macros.h:688
utl::byte_t
unsigned char byte_t
Unsigned character.
Definition:
types.h:31
utl::size_t_max
const size_t size_t_max
Maximum size_t value.
utl::SSLsocket
Secure socket.
Definition:
SSLsocket.h:32
utl::Stream
Stream I/O abstraction.
Definition:
Stream.h:68
utl::uint16_t
unsigned short uint16_t
Unsigned 16-bit integer.
Definition:
types.h:101
utl::init
void init()
Initialize UTL++.
utl::InetHostAddress
Internet host address.
Definition:
InetHostAddress.h:26
ucm
SSLsocket.h
Generated on Tue Feb 7 2017 20:11:33 for libUTL++ by
1.8.13