Comment some code
This commit is contained in:
@@ -33,12 +33,18 @@ namespace ColumnLynx::Net::TCP {
|
||||
return conn;
|
||||
}
|
||||
|
||||
// Start a TCP Connection (Handler for an incoming connection)
|
||||
void start();
|
||||
// Send a message to the TCP client
|
||||
void sendMessage(ServerMessageType type, const std::string& data = "");
|
||||
// Set callback for disconnects
|
||||
void setDisconnectCallback(std::function<void(std::shared_ptr<TCPConnection>)> cb);
|
||||
// Disconnect the client
|
||||
void disconnect();
|
||||
|
||||
// Get the assigned session ID
|
||||
uint64_t getSessionID() const;
|
||||
// Get the assigned AES key; You should probably access this via the Session Registry instead
|
||||
std::array<uint8_t, 32> getAESKey() const;
|
||||
|
||||
private:
|
||||
@@ -51,7 +57,9 @@ namespace ColumnLynx::Net::TCP {
|
||||
mLastHeartbeatSent(std::chrono::steady_clock::now())
|
||||
{}
|
||||
|
||||
// Start the heartbeat routine
|
||||
void mStartHeartbeat();
|
||||
// Handle an incoming TCP message
|
||||
void mHandleMessage(ClientMessageType type, const std::string& data);
|
||||
|
||||
std::shared_ptr<MessageHandler> mHandler;
|
||||
|
||||
@@ -62,10 +62,13 @@ namespace ColumnLynx::Net::TCP {
|
||||
mStartAccept();
|
||||
}
|
||||
|
||||
// Stop the TCP Server
|
||||
void stop();
|
||||
|
||||
private:
|
||||
// Start accepting clients via TCP
|
||||
void mStartAccept();
|
||||
|
||||
asio::io_context &mIoContext;
|
||||
asio::ip::tcp::acceptor mAcceptor;
|
||||
std::unordered_set<TCPConnection::pointer> mClients;
|
||||
|
||||
@@ -42,13 +42,18 @@ namespace ColumnLynx::Net::UDP {
|
||||
mStartReceive();
|
||||
}
|
||||
|
||||
// Stop the UDP server
|
||||
void stop();
|
||||
|
||||
// Send UDP data to an endpoint; Fetched via the Session Registry
|
||||
void sendData(const uint64_t sessionID, const std::string& data);
|
||||
|
||||
private:
|
||||
// Start receiving UDP data
|
||||
void mStartReceive();
|
||||
// Handle an incoming UDP packet
|
||||
void mHandlePacket(std::size_t bytes);
|
||||
|
||||
asio::ip::udp::socket mSocket;
|
||||
asio::ip::udp::endpoint mRemoteEndpoint;
|
||||
std::array<uint8_t, 2048> mRecvBuffer; // Adjust size as needed
|
||||
|
||||
Reference in New Issue
Block a user