1
// ---------------------------------------------------------------------------
3
// - afnix:tls service - tls server class definition -
4
// ---------------------------------------------------------------------------
5
// - This program is free software; you can redistribute it and/or modify -
6
// - it provided that this copyright notice is kept intact. -
8
// - This program is distributed in the hope that it will be useful, but -
9
// - without any warranty; without even the implied warranty of -
10
// - merchantability or fitness for a particular purpose. In no event shall -
11
// - the copyright holder be liable for any direct, indirect, incidental or -
12
// - special damages arising in any way out of the use of this software. -
13
// ---------------------------------------------------------------------------
14
// - copyright (c) 1999-2015 amaury darsch -
15
// ---------------------------------------------------------------------------
17
#ifndef AFNIX_TLSSERVER_HPP
18
#define AFNIX_TLSSERVER_HPP
20
#ifndef AFNIX_TCPSERVER_HPP
21
#include "TcpServer.hpp"
24
#ifndef AFNIX_TLSSOCKET_HPP
25
#include "TlsSocket.hpp"
30
/// The TlsServer class is the server socket class for the tls protocol.
31
/// The class is a wrapper around the tcp server with extra information
32
/// needed to setup a secure channel. Once a connection is accepted (in
33
/// the tcp sense) the handshake can start.
34
/// @author amaury darsch
36
class TlsServer : public TcpServer {
38
/// create a tls server on a ephemeral port
41
/// create a tls server with a host and port
42
/// @param host the host to bind the server
43
/// @param port the port to listen
44
TlsServer (const String& host, t_word port);
46
/// @return the class name
47
String repr (void) const;
49
/// @return an accepted connected tcp socket
50
TcpSocket* accept (void) const;
53
// make the copy constructor private
54
TlsServer (const TlsServer&);
55
// make the assignment operator private
56
TlsServer& operator = (const TlsServer&);
59
/// create a new object in a generic way
60
/// @param argv the argument vector
61
static Object* mknew (Vector* argv);