Skip to content
Snippets Groups Projects
Commit ee6941bb authored by Benny Baumann's avatar Benny Baumann
Browse files

chg: Ensure proper address family when creating TCP server sockets

parent c39a5d85
No related branches found
No related tags found
1 merge request!4Draft: Resolve "Unix Socket Server schreiben"
......@@ -32,6 +32,10 @@
namespace rmrf::net {
static auto_fd create_tcp_server_socket(const socketaddr& socket_identifier) {
if (auto f = socket_identifier.family(); f != AF_INET6 && f != AF_INET) {
throw netio_exception("For now, TCP is only supported over IP(v6).");
}
auto_fd socket_fd{socket(socket_identifier.family(), SOCK_STREAM, 0)};
if (!socket_fd.valid()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment