Quellcode durchsuchen

use tcpserver shutdown

Helmut Pozimski vor 4 Jahren
Ursprung
Commit
89d7671b1c
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 2
      src/main.c
  2. 1 0
      src/tcpserver.c

+ 1 - 2
src/main.c

@@ -50,8 +50,7 @@ static void signal_handler(int signal) {
 		wavfile_close(file);
 	}
 	free(filepath);
-	shutdown(sock, SHUT_RDWR);
-	close(sock);
+	tcpserver_stop(sock);
 	exit(EXIT_SUCCESS);
 }
 

+ 1 - 0
src/tcpserver.c

@@ -49,5 +49,6 @@ int tcpserver_start(const char *address, uint16_t port) {
  *
  */
 void tcpserver_stop(int sock) {
+	shutdown(sock, SHUT_RDWR);
 	close(sock);
 }