Close listening sockets when done

This commit is contained in:
Lucas 2021-01-21 02:26:53 +00:00
parent 74024f001f
commit 3e48720fad
1 changed files with 4 additions and 0 deletions

View File

@ -97,8 +97,12 @@ handle_tcp(const char *port)
{
int s[8];
size_t nsocks = nelems(s);
size_t i;
listen_sock_setup(port, SOCK_STREAM, s, &nsocks);
for (i = 0; i < nsocks; i++)
close(s[i]);
}
static void