Network: Add support for sending/receiving NetPacket over UDP/TCP

Former-commit-id: 5c09a5fa8b499e4204d2312f6d04d8554093a5a4
This commit is contained in:
Lynix
2016-02-04 14:51:26 +01:00
parent 6c0215952d
commit 08caff5ea3
4 changed files with 149 additions and 3 deletions

View File

@@ -13,6 +13,8 @@
namespace Nz
{
class NetPacket;
class NAZARA_NETWORK_API UdpSocket : public AbstractSocket
{
public:
@@ -37,8 +39,10 @@ namespace Nz
std::size_t QueryMaxDatagramSize();
bool Receive(void* buffer, std::size_t size, IpAddress* from, std::size_t* received);
bool ReceivePacket(NetPacket* packet, IpAddress* from);
bool Send(const IpAddress& to, const void* buffer, std::size_t size, std::size_t* sent);
bool SendPacket(const IpAddress& to, const NetPacket& packet);
private:
void OnClose() override;