First working alpha, version a0.4 #7
@@ -20,14 +20,6 @@
|
|||||||
namespace ColumnLynx::Net::TCP {
|
namespace ColumnLynx::Net::TCP {
|
||||||
|
|
||||||
void TCPServer::mStartAccept() {
|
void TCPServer::mStartAccept() {
|
||||||
// A bit of a shotty implementation, might improve later
|
|
||||||
/*std::cout << "Host running pointer: " << *mHostRunning << std::endl;
|
|
||||||
|
|
||||||
if (mHostRunning != nullptr && !(*mHostRunning)) {
|
|
||||||
Utils::log("Server is stopping, not accepting new connections.");
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
mAcceptor.async_accept(
|
mAcceptor.async_accept(
|
||||||
[this](asio::error_code ec, asio::ip::tcp::socket socket) {
|
[this](asio::error_code ec, asio::ip::tcp::socket socket) {
|
||||||
if (ec) {
|
if (ec) {
|
||||||
|
|||||||
@@ -10,12 +10,6 @@
|
|||||||
|
|
||||||
namespace ColumnLynx::Net::UDP {
|
namespace ColumnLynx::Net::UDP {
|
||||||
void UDPServer::mStartReceive() {
|
void UDPServer::mStartReceive() {
|
||||||
// A bit of a shotty implementation, might improve later
|
|
||||||
/*if (mHostRunning != nullptr && !(*mHostRunning)) {
|
|
||||||
Utils::log("Server is stopping, not receiving new packets.");
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
mSocket.async_receive_from(
|
mSocket.async_receive_from(
|
||||||
asio::buffer(mRecvBuffer), mRemoteEndpoint,
|
asio::buffer(mRecvBuffer), mRemoteEndpoint,
|
||||||
[this](asio::error_code ec, std::size_t bytes) {
|
[this](asio::error_code ec, std::size_t bytes) {
|
||||||
@@ -78,8 +72,6 @@ namespace ColumnLynx::Net::UDP {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UDPServer::mSendData(const uint64_t sessionID, const std::string& data) {
|
void UDPServer::mSendData(const uint64_t sessionID, const std::string& data) {
|
||||||
// TODO: Implement
|
|
||||||
|
|
||||||
// Find the IPv4/IPv6 endpoint for the session
|
// Find the IPv4/IPv6 endpoint for the session
|
||||||
std::shared_ptr<const SessionState> session = SessionRegistry::getInstance().get(sessionID);
|
std::shared_ptr<const SessionState> session = SessionRegistry::getInstance().get(sessionID);
|
||||||
if (!session) {
|
if (!session) {
|
||||||
|
|||||||
Reference in New Issue
Block a user