mirror of
https://github.com/opus-tango/http-server-in-c.git
synced 2026-03-20 03:55:25 +00:00
fully close socket on quit
This commit is contained in:
@@ -55,6 +55,7 @@ int main(int argc, char **argv) {
|
|||||||
read(STDIN_FILENO, &c, 1);
|
read(STDIN_FILENO, &c, 1);
|
||||||
if (c == 'q') {
|
if (c == 'q') {
|
||||||
close(server);
|
close(server);
|
||||||
|
shutdown(server, SHUT_RDWR);
|
||||||
printf("Server closed\n");
|
printf("Server closed\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user