StormByte-Network 4.0.0
C++26 networking module of the StormByte suite
Loading...
Searching...
No Matches
server_state.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-Network.
5 *
6 * StormByte-Network original source is dual-licensed:
7 *
8 * 1. GNU Lesser General Public License v3.0 (or later)
9 * You may redistribute and/or modify this file under the terms of the
10 * GNU Lesser General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option)
12 * any later version.
13 *
14 * 2. Commercial license
15 * Alternatively, this file may be used under the terms of a commercial
16 * license agreement with the copyright holder
17 * (David C. Manuelda <StormByte@gmail.com>).
18 *
19 * Both licenses apply only to original StormByte-Network source in this
20 * repository. They do not cover other StormByte modules or any third-party
21 * material shipped with this repository (including everything under
22 * thirdparty/, and in particular the bundled StormByte Buffer tree), which
23 * remains under its own license.
24 *
25 * Neither license grants any patent rights. Any patent licenses required
26 * to use this software or third-party components must be obtained separately
27 * from the patent holders.
28 *
29 * StormByte-Network is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU Lesser General Public License for more details.
33 *
34 * You should have received a copy of the GNU Lesser General Public License
35 * version 3 along with StormByte-Network. If not, see
36 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
37 *
38 * SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-StormByte-Commercial
39 */
40
41#pragma once
42
45#include <StormByte/safe/function.hxx>
46#include <StormByte/safe/optional.hxx>
47#include <StormByte/safe/pointers.hxx>
48#include <StormByte/safe/string.hxx>
49#include <StormByte/safe/thread.hxx>
50
55namespace StormByte {
60 namespace Network {
65 namespace Connection {
69 class Client;
70 }
71
76 namespace Detail {
80 class Session;
81
86 namespace RemoteFile {
91 class Host;
92 }
93
104
115
126
131 enum class CompletionReason: unsigned short {
135 };
136
150
164
176
191
202
213
220 class WakeupChannel;
221 }
222 }
223}
224
226
228
230
232
234
236
238
STORMBYTE_DECLARE_MAYBE_SAFE(StormByte::Buffer::Bridge)
Forward declaration of a Network-owned peer data plane.
std::array< std::byte, 32 > ChannelToken
Fixed-width opaque channel capability.
Definition remote_file_mount.hxx:74
Access
Permitted direction for this mounted channel.
Definition remote_file_mount.hxx:116
Network-owned native wakeup handles, defined out-of-line.
Connection namespace.
Private remote-file implementation namespace.
Network-owned endpoint implementation state.
CompletionReason
Result category returned by a packet worker.
Definition server_state.hxx:131
@ NullHandler
Packet handler returned no response packet.
Definition server_state.hxx:133
@ Success
Packet handling completed successfully.
Definition server_state.hxx:132
@ Error
Packet handling failed.
Definition server_state.hxx:134
CommandType
Event-loop action requested by a worker or callback.
Definition server_state.hxx:196
@ Stop
Stop the event loop.
Definition server_state.hxx:200
@ DisconnectAfterReply
Discard input and close after reply draining.
Definition server_state.hxx:198
@ DisconnectClient
Disconnect the specified client session.
Definition server_state.hxx:197
@ DisconnectAll
Disconnect every client session.
Definition server_state.hxx:199
Network module of the StormByte suite.
StormByte::Safe::Shared< Transport::Packet > PacketPointer
Base-heap shared packet pointer.
Definition typedefs.hxx:132
Root namespace of the StormByte suite.
Event-loop command and optional target client UUID.
Definition server_state.hxx:209
CommandType type
Event-loop action.
Definition server_state.hxx:210
Safe::String uuid
Target client UUID.
Definition server_state.hxx:211
Worker response queued for application on the event loop.
Definition server_state.hxx:145
CompletionReason reason
Worker handler outcome.
Definition server_state.hxx:148
PacketPointer packet
Application response packet.
Definition server_state.hxx:147
Safe::String uuid
Client session UUID.
Definition server_state.hxx:146
Connection retained for synchronized remote-file mount ownership checks.
Definition server_state.hxx:112
Safe::Shared< Connection::Client > connection
Configurable application connection.
Definition server_state.hxx:113
Active file capability and its path reservation.
Definition server_state.hxx:185
RemoteFileMount::ChannelToken token
Released mount capability.
Definition server_state.hxx:189
RemoteFileMount::Access access
Granted access mode.
Definition server_state.hxx:188
Safe::String path_key
Canonical path reservation.
Definition server_state.hxx:187
Safe::Shared< RemoteFile::Host > host
Peer data plane.
Definition server_state.hxx:186
Peer-plane registration shared by the event loop and mounts.
Definition server_state.hxx:123
Safe::Shared< RemoteFile::Host > host
Registered peer data plane.
Definition server_state.hxx:124
Event-loop registration retaining one parser session.
Definition server_state.hxx:101
Safe::Shared< Session > session
Parser retained by the event loop.
Definition server_state.hxx:102
Owned request or internal operation accepted by the worker pool.
Definition server_state.hxx:159
PacketPointer packet
Request packet.
Definition server_state.hxx:161
Safe::String uuid
Client UUID, including embedded nulls.
Definition server_state.hxx:160
Safe::Optional< Safe::Function< void()> > operation
Internal operation without a completion.
Definition server_state.hxx:162
Base-owned execution retained and joined by its Network pool.
Definition server_state.hxx:173
Safe::Shared< Safe::Thread > thread
Execution joined before provider destruction.
Definition server_state.hxx:174