1//
2// SecureServerSocketImpl.cpp
3//
4// Library: NetSSL_OpenSSL
5// Package: SSLSockets
6// Module: SecureServerSocketImpl
7//
8// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
9// and Contributors.
10//
11// SPDX-License-Identifier: BSL-1.0
12//
13
14
15#include "Poco/Net/SecureServerSocketImpl.h"
16
17
18namespace Poco {
19namespace Net {
20
21
22SecureServerSocketImpl::SecureServerSocketImpl(Context::Ptr pContext):
23 _impl(new ServerSocketImpl, pContext)
24{
25}
26
27
28SecureServerSocketImpl::~SecureServerSocketImpl()
29{
30 try
31 {
32 reset();
33 }
34 catch (...)
35 {
36 poco_unexpected();
37 }
38}
39
40
41SocketImpl* SecureServerSocketImpl::acceptConnection(SocketAddress& clientAddr)
42{
43 return _impl.acceptConnection(clientAddr);
44}
45
46
47void SecureServerSocketImpl::connect(const SocketAddress& address)
48{
49 throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket");
50}
51
52
53void SecureServerSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout)
54{
55 throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket");
56}
57
58
59void SecureServerSocketImpl::connectNB(const SocketAddress& address)
60{
61 throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket");
62}
63
64
65void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reusePort)
66{
67 _impl.bind(address, reuseAddress, reusePort);
68 reset(_impl.sockfd());
69}
70
71
72void SecureServerSocketImpl::listen(int backlog)
73{
74 _impl.listen(backlog);
75 reset(_impl.sockfd());
76}
77
78
79void SecureServerSocketImpl::close()
80{
81 reset();
82 _impl.close();
83}
84
85
86int SecureServerSocketImpl::sendBytes(const void* buffer, int length, int flags)
87{
88 throw Poco::InvalidAccessException("Cannot sendBytes() on a SecureServerSocket");
89}
90
91
92int SecureServerSocketImpl::receiveBytes(void* buffer, int length, int flags)
93{
94 throw Poco::InvalidAccessException("Cannot receiveBytes() on a SecureServerSocket");
95}
96
97
98int SecureServerSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& address, int flags)
99{
100 throw Poco::InvalidAccessException("Cannot sendTo() on a SecureServerSocket");
101}
102
103
104int SecureServerSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, int flags)
105{
106 throw Poco::InvalidAccessException("Cannot receiveFrom() on a SecureServerSocket");
107}
108
109
110void SecureServerSocketImpl::sendUrgent(unsigned char data)
111{
112 throw Poco::InvalidAccessException("Cannot sendUrgent() on a SecureServerSocket");
113}
114
115
116bool SecureServerSocketImpl::secure() const
117{
118 return true;
119}
120
121
122} } // namespace Poco::Net
123