Update
Removed Message Queue Sending and receiving is now in one thread (gotta make them separate) Created a very crude Plugin System Renamed AllAndMe to AllAndServer
This commit is contained in:
@ -1,52 +0,0 @@
|
||||
#include "MessageQueue.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
void MessageQueue::EnqueueMessageToSend(const NetworkMessage & msg)
|
||||
{
|
||||
m_sendMutex.lock();
|
||||
m_messagesToSend.emplace_back(msg);
|
||||
m_sendMutex.unlock();
|
||||
}
|
||||
|
||||
void MessageQueue::EnqueueMessageReceived(const NetworkMessage & msg)
|
||||
{
|
||||
m_receivedMutex.lock();
|
||||
DataReceivedEvent ev(msg);
|
||||
m_dataReceivedEvents.push_back(ev);
|
||||
m_receivedMutex.unlock();
|
||||
}
|
||||
|
||||
void MessageQueue::EnqueueDisconnection(const NetworkMessage & msg)
|
||||
{
|
||||
m_disconnectMutex.lock();
|
||||
//std::unique_ptr<DisconnectedEvent> ev(((NetworkMessage)msg).GetData<DisconnectedEvent>());
|
||||
//m_disconnectedEvents.push_back(*(ev.get()));
|
||||
m_disconnectMutex.unlock();
|
||||
}
|
||||
|
||||
void MessageQueue::EnqueueConnection(const NetworkMessage & msg)
|
||||
{
|
||||
m_connectionMutex.lock();
|
||||
NewConnectionEvent ev(msg.GetSenderID(), msg.GetData<void>());
|
||||
m_connectionEvents.push_back(ev);
|
||||
m_connectionMutex.unlock();
|
||||
}
|
||||
|
||||
NetworkMessage MessageQueue::DequeueMessageToSend()
|
||||
{
|
||||
m_sendMutex.lock();
|
||||
NetworkMessage msg = m_messagesToSend.front();
|
||||
m_messagesToSend.erase(m_messagesToSend.begin() + 1);
|
||||
m_sendMutex.unlock();
|
||||
return msg;
|
||||
}
|
||||
|
||||
uint32_t MessageQueue::SendSize()
|
||||
{
|
||||
m_sendMutex.lock();
|
||||
uint32_t size = m_messagesToSend.size();
|
||||
m_sendMutex.unlock();
|
||||
return size;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
#include "NetworkMessage.hpp"
|
||||
#include "HLAPI/NetworkMessage.hpp"
|
||||
#include <cassert>
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
@ -22,7 +23,7 @@ namespace std::net
|
||||
return m_tag;
|
||||
}
|
||||
|
||||
uint8_t *NetworkMessage::SerializeData(uint32_t &size)
|
||||
uint8_t *NetworkMessage::SerializeData(uint32_t &size) const
|
||||
{
|
||||
int32_t sizeOfNetHeader = sizeof(NetworkHeader);
|
||||
|
||||
@ -49,15 +50,24 @@ namespace std::net
|
||||
|
||||
void NetworkMessage::Deserialize(uint8_t *data, uint32_t size)
|
||||
{
|
||||
NetworkHeader buffer;
|
||||
uint32_t sizeOfNetHeader = sizeof(NetworkHeader);
|
||||
memcpy(&(buffer), data, sizeOfNetHeader);
|
||||
NetworkHeader header;
|
||||
memcpy(&(header), data, sizeof(NetworkHeader));
|
||||
|
||||
memcpy(&(m_senderID), data + 4 + sizeOfNetHeader, 4);
|
||||
m_distributionMode = (DistributionMode)data[8 + sizeOfNetHeader];
|
||||
memcpy(&(m_destinationID), data + 5 + sizeOfNetHeader, 4);
|
||||
memcpy(&(m_tag), data + 9 + sizeOfNetHeader, 4);
|
||||
data += sizeof(NetworkHeader);
|
||||
|
||||
m_data = data + 13 + sizeOfNetHeader;
|
||||
DeserializeWithoutHeader(data, header.Size);
|
||||
}
|
||||
void NetworkMessage::DeserializeWithoutHeader(uint8_t* data, uint32_t size)
|
||||
{
|
||||
memcpy(&(m_senderID), data, 4);
|
||||
m_distributionMode = (DistributionMode)data[4];
|
||||
memcpy(&(m_destinationID), data + 5, 4);
|
||||
memcpy(&(m_tag), data + 9, 4);
|
||||
|
||||
if (size - 4 > 13)
|
||||
{
|
||||
m_data = data + 13;
|
||||
m_dataSize = size - 13 - 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
src/HLAPI/Plugin/PluginManager.cpp
Normal file
11
src/HLAPI/Plugin/PluginManager.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include "HLAPI/Plugin/PluginManager.hpp"
|
||||
|
||||
#include "HLAPI/Plugin/Plugin.hpp"
|
||||
|
||||
std::net::PluginManager::PluginManager()
|
||||
{
|
||||
}
|
||||
|
||||
std::net::PluginManager::~PluginManager()
|
||||
{
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
#include "Server.hpp"
|
||||
#include "HLAPI/Server.hpp"
|
||||
|
||||
#include "MessageQueue.hpp"
|
||||
#include "TcpServer.hpp"
|
||||
#include <HLAPI/Plugin/Plugin.hpp>
|
||||
|
||||
#include "HLAPI/TcpServer.hpp"
|
||||
#include "HLAPI/TcpConnectionHandler.hpp"
|
||||
//#include "UdpServer.hpp
|
||||
|
||||
namespace std::net
|
||||
@ -20,4 +22,9 @@ namespace std::net
|
||||
{
|
||||
m_tcpServer->Stop();
|
||||
}
|
||||
|
||||
void Server::AddPlugin(Plugin* plugin)
|
||||
{
|
||||
m_tcpServer->m_connectionHandler->m_pluginManager->AddPlugin(plugin);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
#include "TcpConnection.hpp"
|
||||
#include "HLAPI/TcpConnection.hpp"
|
||||
|
||||
#include "InternalTags.hpp"
|
||||
#include "HLAPI/InternalTags.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
@ -24,7 +24,7 @@ namespace std::net
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
bool TcpConnection::sendMessage(NetworkMessage & msg)
|
||||
bool TcpConnection::sendMessage(const NetworkMessage & msg)
|
||||
{
|
||||
uint32_t size;
|
||||
uint8_t *data = msg.SerializeData(size);
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
#include "TcpConnectionHandler.hpp"
|
||||
#include "HLAPI/TcpConnectionHandler.hpp"
|
||||
|
||||
#include "DisconnectedEvent.hpp"
|
||||
#include "NewConnectionEvent.hpp"
|
||||
#include "InternalTags.hpp"
|
||||
#include "HLAPI/DisconnectedEvent.hpp"
|
||||
#include "HLAPI/NewConnectionEvent.hpp"
|
||||
#include "HLAPI/InternalTags.hpp"
|
||||
|
||||
#include "NetworkMessage.hpp"
|
||||
#include "MessageQueue.hpp"
|
||||
#include "TcpConnection.hpp"
|
||||
#include "TcpListener.hpp"
|
||||
#include "HLAPI/NetworkMessage.hpp"
|
||||
#include "HLAPI/TcpConnection.hpp"
|
||||
#include "VoidNet/TcpListener.hpp"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
@ -16,7 +15,7 @@ namespace std::net
|
||||
TcpConnectionHandler::TcpConnectionHandler(std::shared_ptr<TcpListener> listener_ptr)
|
||||
: m_run(false)
|
||||
, m_listenerPtr(listener_ptr)
|
||||
, m_queue(new MessageQueue())
|
||||
, m_pluginManager(new PluginManager())
|
||||
{
|
||||
}
|
||||
|
||||
@ -36,9 +35,6 @@ namespace std::net
|
||||
|
||||
std::thread receive_thread(&TcpConnectionHandler::HandleReceiveMsgAndConnsThreaded, this);
|
||||
m_receiveThread.swap(receive_thread);
|
||||
|
||||
std::thread send_thread(&TcpConnectionHandler::HandleSendThreaded, this);
|
||||
m_sendThread.swap(send_thread);
|
||||
}
|
||||
|
||||
void TcpConnectionHandler::Stop()
|
||||
@ -82,8 +78,6 @@ namespace std::net
|
||||
client_fd.fd = c->m_client->m_socket->GetNativeSocket();
|
||||
client_fd.events = POLLRDNORM;
|
||||
poll_fds.emplace_back(client_fd);
|
||||
|
||||
m_queue->EnqueueConnection(msg);
|
||||
}
|
||||
|
||||
uint32_t TcpConnectionHandler::GetAvailableID()
|
||||
@ -112,6 +106,11 @@ namespace std::net
|
||||
m_maxConnections = max_connections;
|
||||
}
|
||||
|
||||
void TcpConnectionHandler::HandlePluginMessage(const NetworkMessage& message)
|
||||
{
|
||||
m_pluginManager->HandleMessage(message);
|
||||
}
|
||||
|
||||
void TcpConnectionHandler::HandleReceiveMsgAndConns()
|
||||
{
|
||||
int res = poll(poll_fds.data(), poll_fds.size(), -1);
|
||||
@ -145,129 +144,116 @@ namespace std::net
|
||||
else // not the listening socket
|
||||
{
|
||||
SOCKET c = poll_fds.at(i).fd;
|
||||
std::unique_ptr<uint8_t> header(new uint8_t[sizeof(NetworkHeader*)]());
|
||||
|
||||
uint8_t* header = new uint8_t[sizeof(NetworkHeader)]();
|
||||
|
||||
int32_t read;
|
||||
if ((read = recv(c, (char*)header.get(), sizeof(NetworkHeader*), 0)) != sizeof(NetworkHeader*))
|
||||
if ((read = recv(c, (char*)header, sizeof(NetworkHeader), 0)) != sizeof(NetworkHeader))
|
||||
continue;
|
||||
|
||||
std::unique_ptr<NetworkHeader> net_header((NetworkHeader*)header.get());
|
||||
std::unique_ptr<uint8_t> buffer(new uint8_t[net_header->Size]());
|
||||
NetworkHeader net_header(*(NetworkHeader*)(header));
|
||||
uint8_t *buffer = new uint8_t[net_header.Size]();
|
||||
|
||||
if ((read = recv(c, (char*)buffer.get(), net_header->Size, 0)) == net_header->Size)
|
||||
read = recv(c, (char*)buffer, net_header.Size - 4, 0);
|
||||
if ((read) == net_header.Size - 4)
|
||||
{
|
||||
NetworkMessage msg;
|
||||
msg.Deserialize(buffer.get(), net_header->Size);
|
||||
msg.DeserializeWithoutHeader(buffer, net_header.Size);
|
||||
|
||||
if (msg.GetTag() == (uint32_t)InternalTags::Disconnect)
|
||||
{
|
||||
// i? or i+1
|
||||
poll_fds.erase(poll_fds.begin() + i);
|
||||
|
||||
m_queue->EnqueueDisconnection(msg);
|
||||
}
|
||||
else if (msg.GetTag() == (uint32_t)InternalTags::Connect)
|
||||
m_queue->EnqueueConnection(msg);
|
||||
else
|
||||
m_queue->EnqueueMessageReceived(msg);
|
||||
HandleMessage(msg);
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TcpConnectionHandler::HandleSend()
|
||||
void TcpConnectionHandler::HandleMessage(const NetworkMessage &msg)
|
||||
{
|
||||
if (m_queue->SendSize() > 0)
|
||||
if (msg.GetDistributionMode() == DistributionMode::Others)
|
||||
{
|
||||
NetworkMessage msg = m_queue->DequeueMessageToSend();
|
||||
|
||||
if (msg.GetDistributionMode() == DistributionMode::Others)
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
if (c->GetID() != msg.GetSenderID())
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
if (c->GetID() != msg.GetSenderID())
|
||||
{
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::OthersAndServer)
|
||||
{
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
if (c->GetID() != msg.GetSenderID())
|
||||
{
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
|
||||
//handle to plugins too
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::ID)
|
||||
{
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
if (c->GetID() == msg.GetSenderID())
|
||||
{
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::All)
|
||||
{
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::AllAndMe)
|
||||
{
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
|
||||
//handle to plugins too
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::Server)
|
||||
{
|
||||
//handle just in plugins
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::OthersAndServer)
|
||||
{
|
||||
HandlePluginMessage(msg);
|
||||
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
if (c->GetID() != msg.GetSenderID())
|
||||
{
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::ID)
|
||||
{
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
if (c->GetID() == msg.GetSenderID())
|
||||
{
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::All)
|
||||
{
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::AllAndServer)
|
||||
{
|
||||
HandlePluginMessage(msg);
|
||||
|
||||
m_listMutex.lock();
|
||||
for (int i = 0; i < m_list.size(); i++)
|
||||
{
|
||||
std::shared_ptr<TcpConnection> c = m_list.at(i);
|
||||
|
||||
if (!c->sendMessage(msg))
|
||||
{
|
||||
// it failed - retry? or just disconnect right in the first try
|
||||
}
|
||||
}
|
||||
m_listMutex.unlock();
|
||||
}
|
||||
else if (msg.GetDistributionMode() == DistributionMode::Server)
|
||||
HandlePluginMessage(msg);
|
||||
}
|
||||
|
||||
void TcpConnectionHandler::HandleReceiveMsgAndConnsThreaded()
|
||||
@ -275,10 +261,4 @@ namespace std::net
|
||||
while (m_run.load())
|
||||
HandleReceiveMsgAndConns();
|
||||
}
|
||||
|
||||
void TcpConnectionHandler::HandleSendThreaded()
|
||||
{
|
||||
while (m_run.load())
|
||||
HandleSend();
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
#include "TcpServer.hpp"
|
||||
#include "HLAPI/TcpServer.hpp"
|
||||
|
||||
#include "TcpConnection.hpp"
|
||||
#include "TcpSocketBuilder.hpp"
|
||||
#include "TcpClient.hpp"
|
||||
#include "TcpConnectionHandler.hpp"
|
||||
#include "HLAPI/TcpConnection.hpp"
|
||||
#include "VoidNet/TcpSocketBuilder.hpp"
|
||||
#include "VoidNet/TcpClient.hpp"
|
||||
#include "HLAPI/TcpConnectionHandler.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,25 +1,32 @@
|
||||
#include "Init.hpp"
|
||||
#include "Server.hpp"
|
||||
#include "ByteConverter.hpp"
|
||||
#include "TcpClient.hpp"
|
||||
#include "InternalTags.hpp"
|
||||
#include "NetworkMessage.hpp"
|
||||
#include "VoidNet/Init.hpp"
|
||||
#include "HLAPI/Server.hpp"
|
||||
#include "HLAPI/ByteConverter.hpp"
|
||||
#include "VoidNet/TcpClient.hpp"
|
||||
#include "HLAPI/InternalTags.hpp"
|
||||
#include "HLAPI/NetworkMessage.hpp"
|
||||
#include "HLAPI/Plugin/Plugin.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class Plugin : public std::net::Plugin
|
||||
{
|
||||
virtual void HandleMessage(const std::net::NetworkMessage& message) override
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
std::net::Initialize();
|
||||
std::net::Server server(100);
|
||||
server.AddPlugin(new Plugin());
|
||||
server.Start();
|
||||
|
||||
std::net::TcpClient client;
|
||||
std::net::IPAddress ip("127.0.0.1");
|
||||
client.Connect(ip);
|
||||
|
||||
std::net::TcpClient client2;
|
||||
client2.Connect(ip);
|
||||
|
||||
while (true)
|
||||
{
|
||||
uint32_t data_size;
|
||||
@ -36,23 +43,22 @@ int main()
|
||||
|
||||
uint32_t id = std::ByteConverter::FromBytes<uint32_t>((uint8_t*)(message.GetData<void>()));
|
||||
if (message.GetTag() == (uint32_t)InternalTags::AssignID)
|
||||
std::cout << id << std::endl;
|
||||
}
|
||||
{
|
||||
std::cout << id << std::endl;
|
||||
|
||||
while (client2.HasPendingData(data_size))
|
||||
{
|
||||
std::net::NetworkMessage message2;
|
||||
std::string str = std::string("asd");
|
||||
std::net::NetworkMessage msg(100, std::net::DistributionMode::AllAndServer, 150, 1, &str, sizeof(str));
|
||||
|
||||
uint8_t* bytes2 = new uint8_t[data_size]();
|
||||
|
||||
int32_t read2;
|
||||
client2.Recv(bytes2, data_size, read2);
|
||||
|
||||
message2.Deserialize(bytes2, data_size);
|
||||
|
||||
uint32_t id2 = std::ByteConverter::FromBytes<uint32_t>((uint8_t*)(message2.GetData<void>()));
|
||||
if (message2.GetTag() == (uint32_t)InternalTags::AssignID)
|
||||
std::cout << id2 << std::endl;
|
||||
uint32_t dataa_size;
|
||||
uint8_t* dataaaa = msg.SerializeData(dataa_size);
|
||||
int32_t sent;
|
||||
client.Send(dataaaa, dataa_size, sent);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string* txt = message.GetData<std::string>();
|
||||
std::cout << txt->c_str() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
// https://github.com/mfichman/http
|
||||
|
||||
#include "Cookies.hpp"
|
||||
#include "Parse.hpp"
|
||||
#include "VoidNet/Cookies.hpp"
|
||||
#include "VoidNet/Parse.hpp"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// https://github.com/mfichman/http
|
||||
|
||||
#include "Headers.hpp"
|
||||
#include "VoidNet/Headers.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
// https://github.com/mfichman/http
|
||||
|
||||
#include "Http.hpp"
|
||||
#include "VoidNet/Http.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#include "Socket.hpp"
|
||||
#include "SecureSocket.hpp"
|
||||
#include "VoidNet/Socket.hpp"
|
||||
#include "VoidNet/SecureSocket.hpp"
|
||||
|
||||
#undef DELETE
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "IPAddress.hpp"
|
||||
#include "VoidNet/IPAddress.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// https://github.com/mfichman/http
|
||||
|
||||
#include "Request.hpp"
|
||||
#include "VoidNet/Request.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// https://github.com/mfichman/http
|
||||
|
||||
#include "Response.hpp"
|
||||
#include "Parse.hpp"
|
||||
#include "VoidNet/Response.hpp"
|
||||
#include "VoidNet/Parse.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "SecureSocket.hpp"
|
||||
#include "VoidNet/SecureSocket.hpp"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#include "Socket.hpp"
|
||||
#include "IPAddress.hpp"
|
||||
#include "VoidNet/Socket.hpp"
|
||||
#include "VoidNet/IPAddress.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#include "TcpClient.hpp"
|
||||
#include "TcpSocketBuilder.hpp"
|
||||
#include "VoidNet/TcpClient.hpp"
|
||||
#include "VoidNet/TcpSocketBuilder.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include "TcpListener.hpp"
|
||||
#include "TcpSocketBuilder.hpp"
|
||||
#include "Socket.hpp"
|
||||
#include "TcpClient.hpp"
|
||||
#include "VoidNet/TcpListener.hpp"
|
||||
#include "VoidNet/TcpSocketBuilder.hpp"
|
||||
#include "VoidNet/Socket.hpp"
|
||||
#include "VoidNet/TcpClient.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include "TcpSocketBuilder.hpp"
|
||||
#include "VoidNet/TcpSocketBuilder.hpp"
|
||||
|
||||
#include "Socket.hpp"
|
||||
#include "TcpClient.hpp"
|
||||
#include "TcpListener.hpp"
|
||||
#include "VoidNet/Socket.hpp"
|
||||
#include "VoidNet/TcpClient.hpp"
|
||||
#include "VoidNet/TcpListener.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "UdpSocket.hpp"
|
||||
#include "VoidNet/UdpSocket.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// https://github.com/mfichman/http
|
||||
|
||||
#include "Uri.hpp"
|
||||
#include "Parse.hpp"
|
||||
#include "VoidNet/Uri.hpp"
|
||||
#include "VoidNet/Parse.hpp"
|
||||
|
||||
namespace std::net
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "Util.hpp"
|
||||
#include "VoidNet/Util.hpp"
|
||||
|
||||
std::vector<std::string> std::net::Split(const std::string& str, const std::string& delimiter)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user