close socket
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <errno.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include <unistd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "sinkSender.h"
|
||||
@ -97,6 +98,11 @@ static void sinkSenderSendMinute() {
|
||||
0, (struct sockaddr*)&servaddr,
|
||||
sizeof(servaddr));
|
||||
logmsg(LOG_DEBUG, "%d octets sent", res);
|
||||
|
||||
int rc = close(sockfd);
|
||||
if (rc == -1) {
|
||||
logmsg(LOG_ERR, "close on socket returns %s", strerror(errno));
|
||||
}
|
||||
} else {
|
||||
led(E_RED, true);
|
||||
logmsg(LOG_ERR, "unable to get socket: %s", strerror(errno));
|
||||
|
Reference in New Issue
Block a user