EHS/include/ehs/io/socket/Socket.h
Karutoh bcd71cf2b5
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 1m8s
Build & Release / Linux-AMD64-Build (push) Successful in 1m30s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m21s
Adjusted workflow.
2024-02-05 22:25:30 -08:00

51 lines
948 B
C++

#pragma once
#ifndef EHS_IPV4_HEADER
#define EHS_IPV4_HEADER 60
#endif
#ifndef EHS_IPV6_HEADER
#define EHS_IPV6_HEADER 40
#endif
#ifndef EHS_UDP_HEADER
#define EHS_UDP_HEADER 8
#endif
#ifndef EHS_IPV4_UDP_PAYLOAD
#define EHS_IPV4_UDP_PAYLOAD (EHS_UINT_16_MAX - EHS_IPV4_HEADER - EHS_UDP_HEADER)
#endif
#ifndef EHS_IPV6_UDP_PAYLOAD
#define EHS_IPV6_UDP_PAYLOAD (EHS_UINT_16_MAX - EHS_IPV6_HEADER - EHS_UDP_HEADER)
#endif
namespace ehs
{
enum class AddrType
{
IPV6,
IPV4
};
enum class ContentType
{
APP_MULTIPART_FORMDATA,
APP_FORMURLENCODED,
APP_JAVASCRIPT,
APP_JSON,
APP_XML,
TEXT_PLAIN,
TEXT_HTML,
TEXT_XML,
NONE
};
#if defined(EHS_OS_WINDOWS)
typedef UInt_64 Socket;
#define EHS_INVALID_SOCKET EHS_UINT_64_MAX
#elif defined(EHS_OS_LINUX)
typedef SInt_32 Socket;
#define EHS_INVALID_SOCKET (SInt_32)0xffffffff
#endif
}