EHS/include/ehs/io/socket/Socket.h
karutoh 1a4a1ecd9c
Some checks failed
Build & Release / Linux-x86_64-Build (push) Successful in 40s
Build & Release / Linux-AARCH64-Build (push) Has been cancelled
First commit.
2024-01-31 22:28:19 -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
}