libUTL++
BufferedSSLsocket.h
1 #pragma once
2 
4 
5 #include <libutl/BufferedStream.h>
6 #include <libutl/SSLsocket.h>
7 
9 
10 UTL_NS_BEGIN;
11 
13 
23 
26 {
28 
29 public:
31  {
32  setStream(socket);
33  }
34 
35  BufferedSSLsocket(const InetHostAddress& hostAddr, uint16_t port)
36  {
37  setStream(new SSLsocket(hostAddr, port));
38  }
39 
40  void
41  open(const InetHostAddress& hostAddr, uint16_t port)
42  {
43  pget()->open(hostAddr, port);
44  }
45 
46 private:
47  void
48  init()
49  {
50  setStream(new SSLsocket());
51  }
52 
53  void
54  deInit()
55  {
56  }
57 
58  const SSLsocket*
59  pget() const
60  {
61  ASSERTD(_stream != nullptr);
62  return utl::cast<SSLsocket>(_stream);
63  }
64 
65  SSLsocket*
66  pget()
67  {
68  ASSERTD(_stream != nullptr);
69  return utl::cast<SSLsocket>(_stream);
70  }
71 };
72 
74 
75 UTL_NS_END;
void deInit()
De-initialize UTL++.
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
Definition: macros.h:688
Secure socket.
Definition: SSLsocket.h:32
unsigned short uint16_t
Unsigned 16-bit integer.
Definition: types.h:101
Buffered stream.
Buffered SSL socket stream.
void init()
Initialize UTL++.
#define ASSERTD
Do an assertion in DEBUG mode only.
Internet host address.