libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
SocketExceptions.h
Go to the documentation of this file.
1 /* Copyright 2013-2019 Homegear GmbH
2  *
3  * libhomegear-base is free software: you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public License as
5  * published by the Free Software Foundation, either version 3 of the
6  * License, or (at your option) any later version.
7  *
8  * libhomegear-base is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with libhomegear-base. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  * In addition, as a special exception, the copyright holders give
18  * permission to link the code of portions of this program with the
19  * OpenSSL library under certain conditions as described in each
20  * individual source file, and distribute linked combinations
21  * including the two.
22  * You must obey the GNU Lesser General Public License in all respects
23  * for all of the code used other than OpenSSL. If you modify
24  * file(s) with this exception, you may extend this exception to your
25  * version of the file(s), but you are not obligated to do so. If you
26  * do not wish to do so, delete this exception statement from your
27  * version. If you delete this exception statement from all source
28  * files in the program, then also delete it here.
29 */
30 
31 #ifndef SOCKETEXCEPTIONS_H_
32 #define SOCKETEXCEPTIONS_H_
33 
34 #include "../Exception.h"
35 
36 namespace BaseLib
37 {
38 
40 {
41 public:
42  explicit SocketOperationException(const std::string& message) : Exception(message) {}
43 };
44 
46 {
47 public:
48  explicit SocketSizeMismatchException(const std::string& message) : SocketOperationException(message) {}
49 };
50 
52 {
53 public:
54  enum class SocketTimeOutType
55  {
56  undefined,
57  selectTimeout,
58  readTimeout
59  };
60 
61  explicit SocketTimeOutException(const std::string& message) : SocketOperationException(message) {}
62  SocketTimeOutException(const std::string& message, SocketTimeOutType type) : SocketOperationException(message), _type(type) {}
63 
64  SocketTimeOutType getType() { return _type; }
65 private:
67 };
68 
70 {
71 public:
72  explicit SocketClosedException(const std::string& message) : SocketOperationException(message) {}
73 };
74 
76 {
77 public:
78  explicit SocketInvalidParametersException(const std::string& message) : SocketOperationException(message) {}
79 };
80 
82 {
83 public:
84  explicit SocketDataLimitException(const std::string& message) : SocketOperationException(message) {}
85 };
86 
88 {
89 public:
90  explicit SocketSslException(const std::string& message) : SocketOperationException(message) {}
91 };
92 
94 {
95 public:
96  explicit SocketSslHandshakeFailedException(const std::string& message) : SocketSslException(message) {}
97 };
98 
100 {
101 public:
102  explicit SocketBindException(const std::string& message) : SocketOperationException(message) {}
103 };
104 
106 {
107 public:
108  explicit SocketAddressInUseException(const std::string& message) : SocketBindException(message) {}
109 };
110 
111 }
112 
113 #endif
SocketClosedException(const std::string &message)
Definition: SocketExceptions.h:72
SocketSizeMismatchException(const std::string &message)
Definition: SocketExceptions.h:48
Definition: SocketExceptions.h:69
Definition: SocketExceptions.h:93
Definition: BaseLib.cpp:34
Definition: SocketExceptions.h:81
Definition: SocketExceptions.h:39
SocketTimeOutException(const std::string &message)
Definition: SocketExceptions.h:61
Definition: SocketExceptions.h:87
Definition: SocketExceptions.h:45
SocketTimeOutException(const std::string &message, SocketTimeOutType type)
Definition: SocketExceptions.h:62
SocketSslException(const std::string &message)
Definition: SocketExceptions.h:90
Definition: SocketExceptions.h:99
SocketDataLimitException(const std::string &message)
Definition: SocketExceptions.h:84
SocketSslHandshakeFailedException(const std::string &message)
Definition: SocketExceptions.h:96
SocketTimeOutType getType()
Definition: SocketExceptions.h:64
SocketBindException(const std::string &message)
Definition: SocketExceptions.h:102
Definition: SocketExceptions.h:51
Definition: SocketExceptions.h:75
SocketOperationException(const std::string &message)
Definition: SocketExceptions.h:42
Base class for all exceptions defined in Homegear.
Definition: Exception.h:41
SocketTimeOutType
Definition: SocketExceptions.h:54
SocketInvalidParametersException(const std::string &message)
Definition: SocketExceptions.h:78
SocketAddressInUseException(const std::string &message)
Definition: SocketExceptions.h:108
Definition: SocketExceptions.h:105