2024-12-01 19:35:24 +00:00
|
|
|
//| Copyright: (C) 2020-2024 Kevin Larke <contact AT larke DOT org>
|
|
|
|
//| License: GNU GPL version 3.0 or above. See the accompanying LICENSE file.
|
2020-03-23 14:41:28 +00:00
|
|
|
#ifndef cwSocketDecls_H
|
|
|
|
#define cwSocketDecls_H
|
|
|
|
|
|
|
|
namespace cw
|
|
|
|
{
|
|
|
|
namespace sock
|
|
|
|
{
|
|
|
|
typedef uint16_t portNumber_t;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
kConnectCbId,
|
2020-04-01 14:46:31 +00:00
|
|
|
kReceiveCbId,
|
|
|
|
kDisconnectCbId,
|
|
|
|
} cbOpId_t;
|
2020-03-23 14:41:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
kNonBlockingFl = 0x000, // Create a non-blocking socket.
|
|
|
|
kBlockingFl = 0x001, // Create a blocking socket.
|
|
|
|
kTcpFl = 0x002, // Create a TCP socket rather than a UDP socket.
|
|
|
|
kBroadcastFl = 0x004, //
|
|
|
|
kReuseAddrFl = 0x008, //
|
|
|
|
kReusePortFl = 0x010, //
|
|
|
|
kMultiCastTtlFl = 0x020, //
|
|
|
|
kMultiCastLoopFl = 0x040, //
|
|
|
|
kListenFl = 0x080, // Use this socket to listen for incoming connections
|
|
|
|
kStreamFl = 0x100, // Connected stream (not Datagram)
|
2023-07-04 16:02:13 +00:00
|
|
|
kTcpNoDelayFl = 0x200, // TCP stream option only (Implements TCP_NODELAY)
|
2020-03-23 14:41:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
// port 0 is reserved by and is therefore a convenient invalid port number
|
|
|
|
kInvalidPortNumber = 0
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|