53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
/***
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Networking.hpp
|
|
Date: 2022-8-15
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
// Internal include
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include <Aurora/IO/Net/NetExperimental.hpp>
|
|
|
|
// Platform network headers
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
#include <WinSock2.h>
|
|
#include <ws2tcpip.h>
|
|
#include <mswsock.h>
|
|
#elif defined(AURORA_IS_POSIX_DERIVED)
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
#include <arpa/inet.h>
|
|
#include <fcntl.h>
|
|
#include <netdb.h>
|
|
#include <netinet/tcp.h>
|
|
#endif
|
|
|
|
// IO
|
|
#include <Source/IO/Loop/LSHandle.hpp>
|
|
|
|
// Async FIO
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
#include <Source/IO/FS/Async.NT.hpp>
|
|
#elif defined(AURORA_IS_LINUX_DERIVED)
|
|
#include <Source/IO/UNIX/IOSubmit.Linux.hpp>
|
|
#include <Source/IO/FS/Async.Linux.hpp>
|
|
#else
|
|
|
|
#endif
|
|
|
|
namespace Aurora::IO::Net
|
|
{
|
|
static const auto kDefaultStreamSize = 32 * 1024; // ~960 clients for 30MB of 2x 32KiB streams. Seems... reasonable.
|
|
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
inline INT(__stdcall *GetAddrInfoExCancel_f)(
|
|
LPHANDLE lpHandle
|
|
);
|
|
#endif
|
|
|
|
bool IsNetReady();
|
|
} |