Low-level network communications, especially for TCP/UDP.
More...
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <ifaddrs.h>
#include <stdexcept>
Go to the source code of this file.
|
typedef int | SOCKET |
| Windows defines SOCKET, so we define it for non-Windows manually. More...
|
|
Low-level network communications, especially for TCP/UDP.
- See also
- Some inital ideas and pieces of code take from https://linux.m2osw.com/c-implementation-udp-clientserver
XPMP2::SocketNetworking: Any network socket connection
XPMP2::UDPReceiver: listens to and receives UDP datagram
XPMP2::UDPMulticast: sends and receives multicast UDP datagrams
XPMP2::TCPConnection: receives incoming TCP connection
- Author
- Birger Hoppe
- Copyright
- (c) 2019-2024 Birger Hoppe
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
◆ XPMP2::SockAddrTy.__unnamed4__
union XPMP2::SockAddrTy.__unnamed4__ |
Class Members |
sockaddr |
sa |
|
sockaddr_in |
sa_in |
|
sockaddr_in6 |
sa_in6 |
|
◆ XPMP2::InetAddrTy.__unnamed6__
union XPMP2::InetAddrTy.__unnamed6__ |
Class Members |
uint32_t |
addr[4] |
|
struct in6_addr |
in6_addr |
|
struct in_addr |
in_addr |
|
◆ __APPLE_USE_RFC_3542
#define __APPLE_USE_RFC_3542 |
◆ _GNU_SOURCE
◆ SOCKET
Windows defines SOCKET, so we define it for non-Windows manually.
◆ INVALID_SOCKET
constexpr SOCKET INVALID_SOCKET = -1 |
|
constexpr |