Comment some code

This commit is contained in:
2025-11-26 21:52:01 +01:00
parent 84c00b7bcb
commit d2242ebbc7
12 changed files with 174 additions and 106 deletions

View File

@@ -63,17 +63,26 @@ namespace ColumnLynx::Net::TCP {
}
}
// Starts the TCP Client and initiaties the handshake
void start();
// Sends a TCP message to the server
void sendMessage(ClientMessageType type, const std::string& data = "");
// Attempt to gracefully disconnect from the server
void disconnect(bool echo = true);
// Get the handshake status
bool isHandshakeComplete() const;
// Get the connection status
bool isConnected() const;
private:
// Start the heartbeat routine
void mStartHeartbeat();
// Handle an incoming TCP message
void mHandleMessage(ServerMessageType type, const std::string& data);
// TODO: Move ptrs to smart ptrs
bool mConnected = false;
bool mHandshakeComplete = false;
tcp::resolver mResolver;

View File

@@ -25,12 +25,17 @@ namespace ColumnLynx::Net::UDP {
mStartReceive();
}
// Start the UDP client
void start();
// Send a UDP message
void sendMessage(const std::string& data = "");
// Stop the UDP client
void stop();
private:
// Start the UDP listener routine
void mStartReceive();
// Handle an incoming UDP message
void mHandlePacket(std::size_t bytes);
asio::ip::udp::socket mSocket;