AuroraRuntime/Include/Aurora/IO/Net/INetSrvSockets.hpp
Reece Wilson efc02d24f7 [*] Refactor RandomDef: bSecure, ::SetQuickRng()
[*] Default initialize net protocols to zero (tcp)
[*] Warning under AuUInt8 &ByteBuffer::operator[](AuUInt idx)
2022-09-27 17:30:26 +01:00

55 lines
1.3 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 {};
};
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;
};
};