OnixS C++ CME MDP Conflated TCP Handler 1.3.6
API Documentation
Loading...
Searching...
No Matches
SessionException.h
Go to the documentation of this file.
1/*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable OnixS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19
20#pragma once
21
24
25#include <string>
26
27#if WIN32
28#pragma warning(push)
29#pragma warning(disable : 4275)
30#pragma warning(disable : 4251)
31#endif
32
33namespace OnixS {
34namespace CME {
35namespace ConflatedTCP {
36namespace Exceptions{
37
41class ONIXS_CONFLATEDTCP_EXPORTED SessionException : public std::exception
42{
43public:
44 SessionException(SessionErrorReason::Enum reason, const std::string& message);
45
46 SessionException(SessionErrorReason::Enum reason, const std::string& message, const std::exception& cause);
47
49
51
53 {
54 return reason_;
55 }
56
57 const std::string& toString() const
58 {
59 return message_;
60 }
61
62private:
63 std::string message_;
65};
66
83
95
100 : public SessionException
101{
102public:
105
107
109 {
110 return actualSeqNum_;
111 }
112
114 {
115 return expectedSeqNum_;
116 }
117
119
120private:
121 SeqNumber actualSeqNum_;
122 SeqNumber expectedSeqNum_;
123 std::vector<unsigned char> buffer_;
124};
125
130 : public SessionException
131{
132public:
133 explicit ResponseTimeoutException(const std::string& rejectReason, int timeoutMilliseconds)
135 , timeout_(timeoutMilliseconds)
136 {}
137
139
141 int timeout() const
142 {
143 return timeout_;
144 }
145
146private:
147 int timeout_;
148};
149
154 : public SessionException
155{
156public:
158
160
161 std::string rejectReason() const
162 {
163 return rejectReason_;
164 }
165
167 {
168 return errorCodes_;
169 }
170
171private:
172 std::string rejectReason_;
173 Messaging::ErrorCodes::Enum errorCodes_;
174};
175
187
201
212
213}
214}
215}
216}
217
218#if WIN32
219#pragma warning(pop)
220#endif
#define ONIXS_CONFLATEDTCP_OVERRIDE
Definition Compiler.h:180
#define ONIXS_CONFLATEDTCP_EXPORTED
Definition Compiler.h:175
#define ONIXS_CONFLATEDTCP_NOTHROW
Definition Compiler.h:176
#define ONIXS_CONFLATEDTCP_DEFAULT
Definition Compiler.h:202
CannotEstablishLinkException(const std::string &rejectReason, const std::exception &cause)
Constructor.
LinkErrorException(const std::string &rejectReason)
NegotiationRejectException(Messaging::NegotiationReject201 reject)
ResponseTimeoutException(const std::string &rejectReason, int timeoutMilliseconds)
SessionException(SessionErrorReason::Enum reason, const std::string &message, const std::exception &cause)
SessionException(SessionErrorReason::Enum reason, const std::string &message)
const char * what() const noexcept override
UnexpectedMessageTypeException(const std::string &rejectReason, Messaging::SbeMessage incomingMessage)
UnexpectedSequenceNumberException(Messaging::SbeMessage receivedMessage, const std::string &rejectReason, SeqNumber actualSeqNum, SeqNumber expectedSeqNum)
Messaging::UInt32 SeqNumber
Definition Messaging.h:58