AuroraRuntime/Include/Aurora/IO/Net/INetSrvSockets.hpp
Reece Wilson f86665fd36 [+] Net: TCP servers can now be multi-threaded
[+] Net: Added missing UDP send datagram
[*] IO bug fixes
2022-11-17 20:58:48 +00:00

56 lines
1.4 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: INetSrvSockets.hpp
Date: 2022-8-15
Author: Reece
***/
#pragma once
namespace Aurora::IO::Net
{
struct ISocketServer;
struct NetSocketConnect
{
NetEndpoint endpoint;
AuSPtr<ISocketDriver> pDriver;
AuUInt32 uMaxConnectTimeMs {};
};
struct NetSocketConnectMany
{
ETransportProtocol protocol {};
AuList<IPAddress> ips;
AuUInt16 uPort {};
AuSPtr<ISocketDriver> pDriver;
AuUInt32 uMaxConnectTimeMs {};
};
struct NetSocketBind
{
ETransportProtocol protocol {};
IPAddress ip;
AuUInt16 uPort {};
AuSPtr<ISocketDriverFactory> pFactory;
AuSPtr<ISocketServerDriver> pDriver;
AuUInt uMaxConnections {};
AuUInt uMaxAcceptBacklog {};
bool bMultiThreadTCP {};
};
struct NetSocketBindEx : NetSocketBind
{
AuUInt32 uUDPTimeoutMs {};
};
struct INetSrvSockets
{
virtual AuSPtr<ISocket> Connect(const NetSocketConnect &netConnect) = 0;
virtual AuSPtr<ISocket> ConnectMany(const NetSocketConnectMany &netConnectMany) = 0;
virtual AuSPtr<ISocketServer> NewServer(const NetSocketBind &netBind) = 0;
virtual AuSPtr<ISocketServer> NewServerEx(const NetSocketBindEx &netBindEx) = 0;
};
};