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 | |
18 | namespace Poco { |
19 | namespace Net { |
20 | |
21 | |
22 | SecureServerSocketImpl::SecureServerSocketImpl(Context::Ptr pContext): |
23 | _impl(new ServerSocketImpl, pContext) |
24 | { |
25 | } |
26 | |
27 | |
28 | SecureServerSocketImpl::~SecureServerSocketImpl() |
29 | { |
30 | try |
31 | { |
32 | reset(); |
33 | } |
34 | catch (...) |
35 | { |
36 | poco_unexpected(); |
37 | } |
38 | } |
39 | |
40 | |
41 | SocketImpl* SecureServerSocketImpl::acceptConnection(SocketAddress& clientAddr) |
42 | { |
43 | return _impl.acceptConnection(clientAddr); |
44 | } |
45 | |
46 | |
47 | void SecureServerSocketImpl::connect(const SocketAddress& address) |
48 | { |
49 | throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket" ); |
50 | } |
51 | |
52 | |
53 | void SecureServerSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout) |
54 | { |
55 | throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket" ); |
56 | } |
57 | |
58 | |
59 | void SecureServerSocketImpl::connectNB(const SocketAddress& address) |
60 | { |
61 | throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket" ); |
62 | } |
63 | |
64 | |
65 | void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reusePort) |
66 | { |
67 | _impl.bind(address, reuseAddress, reusePort); |
68 | reset(_impl.sockfd()); |
69 | } |
70 | |
71 | |
72 | void SecureServerSocketImpl::listen(int backlog) |
73 | { |
74 | _impl.listen(backlog); |
75 | reset(_impl.sockfd()); |
76 | } |
77 | |
78 | |
79 | void SecureServerSocketImpl::close() |
80 | { |
81 | reset(); |
82 | _impl.close(); |
83 | } |
84 | |
85 | |
86 | int SecureServerSocketImpl::sendBytes(const void* buffer, int length, int flags) |
87 | { |
88 | throw Poco::InvalidAccessException("Cannot sendBytes() on a SecureServerSocket" ); |
89 | } |
90 | |
91 | |
92 | int SecureServerSocketImpl::receiveBytes(void* buffer, int length, int flags) |
93 | { |
94 | throw Poco::InvalidAccessException("Cannot receiveBytes() on a SecureServerSocket" ); |
95 | } |
96 | |
97 | |
98 | int 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 | |
104 | int SecureServerSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, int flags) |
105 | { |
106 | throw Poco::InvalidAccessException("Cannot receiveFrom() on a SecureServerSocket" ); |
107 | } |
108 | |
109 | |
110 | void SecureServerSocketImpl::sendUrgent(unsigned char data) |
111 | { |
112 | throw Poco::InvalidAccessException("Cannot sendUrgent() on a SecureServerSocket" ); |
113 | } |
114 | |
115 | |
116 | bool SecureServerSocketImpl::secure() const |
117 | { |
118 | return true; |
119 | } |
120 | |
121 | |
122 | } } // namespace Poco::Net |
123 | |