update removing error messages

master
Steffen Pohle 1 month ago
parent c721f4db49
commit 5ce2204d2c

@ -29,7 +29,6 @@ int dns_filladdr (string host, string port, int ai_family, struct sockaddr_stora
hints.ai_socktype = SOCK_DGRAM;
if ((err = getaddrinfo (host.c_str(), port.c_str(), &hints, &res)) < 0) {
fprintf (stdout, "dns_filladdr (getaddrinfo):%s\n", gai_strerror (err));
return -1;
}

@ -50,7 +50,6 @@ int UDP::Listen(int port) {
servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
servAddr.sin_port = htons(localport);
if (bind (sock, (struct sockaddr *) &servAddr,sizeof(servAddr)) < 0) {
printf("%s: bind error: %s \n",__FUNCTION__, strerror(errno));
return 0;
}
return 1;
@ -80,7 +79,6 @@ long int UDP::Read(string *source, char *buffer, long int len) {
addrlen = sizeof(srcAddr);
n = recvfrom(sock, buffer, len, 0, (sockaddr *) &srcAddr, &addrlen);
if(n<0) {
printf("%s: recvfrom error:%s\n",__FUNCTION__, strerror(errno));
return -1;
}
@ -115,7 +113,6 @@ long int UDP::Write(string destaddr, char *buffer, long int len) {
if (!IsListen()) {
/* socket creation */
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
printf("%s: socket error: %s \n",__FUNCTION__, strerror(errno));
return -1;
}
}
@ -133,7 +130,6 @@ long int UDP::Write(string destaddr, char *buffer, long int len) {
dns_filladdr (host, port, PF_INET, &dstAddr);
if (sendto (s, buffer, len, 0, (sockaddr *) &dstAddr, addrlen) == -1) {
printf("%s: sendto error: %s \n",__FUNCTION__, strerror(errno));
return -1;
}
@ -151,7 +147,6 @@ int UDP::IsData(int timeout_ms) {
struct timeval tval;
if (sock <= 0) {
printf ("isData:socket error\n");
return -1;
}

Loading…
Cancel
Save