mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 03:19:19 +02:00
motiontelemetry changes
This commit is contained in:
@@ -20,11 +20,8 @@ motiontelemetry::motiontelemetry()
|
||||
struct addrinfo hints, *res;
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
|
||||
protoent *pe = getprotobyname(conf.proto.c_str());
|
||||
if (!pe)
|
||||
throw std::runtime_error("motiontelemetry: unknown protocol");
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = pe->p_proto;
|
||||
hints.ai_socktype = (conf.proto == "tcp" ? SOCK_STREAM : SOCK_DGRAM);
|
||||
|
||||
if (getaddrinfo(conf.address.c_str(), conf.port.c_str(), &hints, &res))
|
||||
throw std::runtime_error("motiontelemetry: getaddrinfo failed");
|
||||
|
||||
Reference in New Issue
Block a user