Commit 66325f9
committed
Polymorphic codecs and transports
New features:
- Session is now a move-only type that can be instantiated on the stack.
- Deprecated Session::create.
- Added ConnectionWish and ConnectionWishList which should now be
used in place of the old Connection and ConnectionList classes.
- Passing ConnectionWish and ConnectionWishList via
Session::connect is now preferred over passing the legacy
Connector instances via Session::create.
- TcpHost and UdsPath now have withFormat methods which generate a
ConnectionWish that can be passed to Session.
- The authenticate, publish, yield, and cancel methods of Session
not taking a completion handler now return an ErrorOrDone. The
thread-safe overloads for those now return a
`std::future<ErrorOrDone>`.
- AnyCompletionExecutor is now used by session to contain the user
executor.
- Added Session::ongoingCall for progressive call results, which
automatically applies rpc.withProgessiveResults(true).
- Renamed Session::reset to Session::terminate, leaving the former
as a deprecated alias.
- Renamed Session::userExecutor to Session::fallbackExecutor,
leaving the former as a deprecated alias.
- Session::fallbackExecutor type relaxed to AnyCompletionExecutor.
- Handlers registered via Session's setWarningHandler,
setTraceHandler, and setStateChangeHandler will no longer be
fired after Session::terminate is called and before
Session::connect is called.
- Added wamp::spawn and wamp::YieldContext in <cppwamp/spawn.hpp>, which
are aliases to their Boost.Asio counterparts.
- Added wamp::spawnCompletionHandler and
wamp::CompletionYieldContext to support spawning coroutines via
Event::executor and Invocation::executor.
- When CPPWAMP_USE_COMPLETION_YIELD_CONTEXT is defined,
wamp::BasicYieldContext<wamp::AnyCompletionExecutor> will be passed to
coroutines spawned via Event/Invocation unpackers. The relaxes the
requirement that the Session::userExecutor() originate from
boost::asio::io_context.
- When CPPWAMP_USE_COMPLETION_YIELD_CONTEXT and
ASIO_DISABLE_BOOST_COROUTINE are defined, the coroutine
Event/Invocation unpackers will use the new Boost.Context-based
coroutines introduced in Boost 1.80.0.
- Instead of throwing an exception, Session now emits a
TransportErrc::badTxLength error via the completion handler or return
value when the payload exceeds the transport's limit.
- Challenge::authenticate, Invocation::yield and Interruption::yield
now have thread-safe and non-thread-safe overloads.
- Added SessionErrc error codes corresponding to new predefined error
URIs that have appeared in the WAMP spec.
- Added Session::setLogHandler which takes a handler of type
'void (LogEntry)' and unifies all log event handling.
- Added Session::setLogLevel for use with Session::setLogHandler.
- Renamed AsioContext to IoContext, leaving the former as a deprecated
alias.
- Deprecated AsioErrorCode.
- Deprecated ProtocolErrc and ProtocolCategory in favor of
SessionErrc::protocolViolation.
- Deprecated Session::setWarningHandler and Session::setTraceHandler in
favor of Session::setLogHandler.
Implementation improvements:
- Adding more codecs or transports in the future will no longer
result in a combinatorial explosion of explicit template instantions
due to the number of transport/codec combinations.
- Codecs are now specializations of SinkEncoder and SourceDecoder.
- Simplified codec tags to only provide their numeric ID.
- Added AnyCodec polymorphic wrapper for codecs.
- Added Transporting interface class which replaces the old Transport
type requirement.
- internal::Client is now non-templated and is retained by Session
during the latter's lifetime.
- Session::connect logic has been moved to internal::Client.
- Renamed internal::AsioTransport to internal::RawsockTransport and
simplified its previously convoluted design.
- internal::RawsockConnector and internal::RawsockTransport now use
policy classes instead of polymorphism to alter their behavior for
tests.
- Tidying of transport tests.
- internal::Peer composition instead of inheritance.
- Avoid unnecessary boost::asio::post in intermediate handlers.
Beaking Changes:
- Session::call can no longer be used for progessive call results, use
Session::ongoingCall instead.
- The Session destructor now automatically invokes Session::disconnect
instead of Session::terminate, to better emulate the cancellation
behavior of Asio sockets being destroyed.
- Event::executor and Invocation::executor can no longer be directly
used by Boost.Coroutine-based boost::asio::spawn to spawn coroutines.
- The undecorated Challenge::authenticate, Invocation::yield and
Interruption::yield are no longer thread-safe.1 parent 29153f6 commit 66325f9
File tree
107 files changed
+8858
-6681
lines changed- cmake
- cppwamp
- include/cppwamp
- coro
- internal
- src
- doc
- examples
- asynctimeclient
- asynctimeservice
- chat
- coro20timeclient
- coro20timeservice
- futuretimeclient
- futuretimeservice
- stacklesstimeclient
- stacklesstimeservice
- timeclient
- timeservice
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
107 files changed
+8858
-6681
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 74 | | |
80 | 75 | | |
| 76 | + | |
81 | 77 | | |
82 | 78 | | |
83 | 79 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 80 | + | |
89 | 81 | | |
90 | 82 | | |
91 | 83 | | |
| |||
119 | 111 | | |
120 | 112 | | |
121 | 113 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
134 | 126 | | |
135 | 127 | | |
136 | 128 | | |
137 | 129 | | |
138 | 130 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
148 | 142 | | |
149 | 143 | | |
150 | 144 | | |
151 | 145 | | |
152 | | - | |
| 146 | + | |
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
| |||
160 | 154 | | |
161 | 155 | | |
162 | 156 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
171 | 167 | | |
172 | 168 | | |
173 | 169 | | |
174 | 170 | | |
175 | 171 | | |
176 | | - | |
| 172 | + | |
177 | 173 | | |
178 | 174 | | |
179 | 175 | | |
| |||
185 | 181 | | |
186 | 182 | | |
187 | 183 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
195 | 187 | | |
| 188 | + | |
| 189 | + | |
196 | 190 | | |
197 | 191 | | |
198 | 192 | | |
199 | 193 | | |
200 | 194 | | |
201 | | - | |
202 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
203 | 198 | | |
204 | 199 | | |
205 | 200 | | |
206 | | - | |
| 201 | + | |
207 | 202 | | |
208 | 203 | | |
209 | 204 | | |
| |||
212 | 207 | | |
213 | 208 | | |
214 | 209 | | |
215 | | - | |
| 210 | + | |
216 | 211 | | |
217 | | - | |
| 212 | + | |
218 | 213 | | |
219 | | - | |
| 214 | + | |
220 | 215 | | |
221 | 216 | | |
222 | 217 | | |
| |||
227 | 222 | | |
228 | 223 | | |
229 | 224 | | |
230 | | - | |
| 225 | + | |
231 | 226 | | |
232 | 227 | | |
233 | 228 | | |
234 | 229 | | |
235 | 230 | | |
236 | | - | |
237 | | - | |
| 231 | + | |
| 232 | + | |
238 | 233 | | |
239 | 234 | | |
240 | 235 | | |
| |||
245 | 240 | | |
246 | 241 | | |
247 | 242 | | |
248 | | - | |
| 243 | + | |
| 244 | + | |
249 | 245 | | |
250 | 246 | | |
251 | 247 | | |
252 | 248 | | |
253 | | - | |
| 249 | + | |
254 | 250 | | |
255 | 251 | | |
256 | 252 | | |
257 | 253 | | |
258 | | - | |
| 254 | + | |
259 | 255 | | |
260 | | - | |
261 | | - | |
| 256 | + | |
| 257 | + | |
262 | 258 | | |
263 | | - | |
| 259 | + | |
264 | 260 | | |
265 | 261 | | |
266 | 262 | | |
| |||
269 | 265 | | |
270 | 266 | | |
271 | 267 | | |
272 | | - | |
| 268 | + | |
273 | 269 | | |
274 | 270 | | |
275 | 271 | | |
| |||
279 | 275 | | |
280 | 276 | | |
281 | 277 | | |
282 | | - | |
| 278 | + | |
| 279 | + | |
283 | 280 | | |
284 | 281 | | |
285 | | - | |
| 282 | + | |
286 | 283 | | |
287 | 284 | | |
288 | 285 | | |
289 | 286 | | |
290 | | - | |
| 287 | + | |
291 | 288 | | |
292 | | - | |
| 289 | + | |
293 | 290 | | |
294 | | - | |
| 291 | + | |
295 | 292 | | |
296 | 293 | | |
297 | 294 | | |
| |||
300 | 297 | | |
301 | 298 | | |
302 | 299 | | |
303 | | - | |
| 300 | + | |
304 | 301 | | |
305 | 302 | | |
306 | 303 | | |
| |||
309 | 306 | | |
310 | 307 | | |
311 | 308 | | |
312 | | - | |
| 309 | + | |
| 310 | + | |
313 | 311 | | |
314 | 312 | | |
315 | 313 | | |
316 | 314 | | |
317 | 315 | | |
318 | 316 | | |
319 | 317 | | |
320 | | - | |
| 318 | + | |
321 | 319 | | |
322 | 320 | | |
323 | 321 | | |
324 | 322 | | |
325 | | - | |
| 323 | + | |
326 | 324 | | |
327 | | - | |
328 | | - | |
| 325 | + | |
| 326 | + | |
329 | 327 | | |
330 | | - | |
| 328 | + | |
331 | 329 | | |
332 | 330 | | |
333 | 331 | | |
| |||
336 | 334 | | |
337 | 335 | | |
338 | 336 | | |
339 | | - | |
| 337 | + | |
340 | 338 | | |
341 | 339 | | |
342 | 340 | | |
343 | 341 | | |
344 | 342 | | |
345 | 343 | | |
346 | | - | |
| 344 | + | |
347 | 345 | | |
348 | 346 | | |
349 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
0 commit comments