2022-08-28 19:02:06 +00:00
|
|
|
/***
|
|
|
|
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;
|
2022-09-02 19:53:25 +00:00
|
|
|
AuUInt32 uMaxConnectTimeMs {};
|
2022-08-28 19:02:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NetSocketConnectMany
|
|
|
|
{
|
2022-09-27 16:30:26 +00:00
|
|
|
ETransportProtocol protocol {};
|
2022-08-28 19:02:06 +00:00
|
|
|
AuList<IPAddress> ips;
|
|
|
|
AuUInt16 uPort {};
|
|
|
|
AuSPtr<ISocketDriver> pDriver;
|
|
|
|
AuUInt32 uMaxConnectTimeMs {};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NetSocketBind
|
|
|
|
{
|
2022-09-27 16:30:26 +00:00
|
|
|
ETransportProtocol protocol {};
|
2022-08-28 19:02:06 +00:00
|
|
|
IPAddress ip;
|
|
|
|
AuUInt16 uPort {};
|
|
|
|
AuSPtr<ISocketDriverFactory> pFactory;
|
|
|
|
AuSPtr<ISocketServerDriver> pDriver;
|
|
|
|
AuUInt uMaxConnections {};
|
|
|
|
AuUInt uMaxAcceptBacklog {};
|
2022-11-17 20:56:41 +00:00
|
|
|
bool bMultiThreadTCP {};
|
2022-08-28 19:02:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|