Hi, i have question about accept call interrupting. As you can see I have a loop which is controlled by boolean not_ended. I set this var to 0 (false) in a separate function.
I would like to know how should I manage to interrupt this accept loop properly. When I set the not_ended I need to interrupt the accept call somehow. Directly closing socket causes:
Problem with accept call
: Bad file descriptor
int sd, not_ended = 1;
while (not_ended) {
sd = accept(socket, (struct sockaddr*) &from_serv, &addrlen_serv);
/* threading stuff */
}
Thanks in advance!