Projects STRLCPY jellyfish Commits 2f25bf4a
🤬
  • close socket

    if accept returns -1 socket is not opened, so it cant be closed, maybe there should be first socket (sock) yes?
  • Loading...
  • Sun Dro committed 9 years ago
    2f25bf4a
    1 parent c876e480
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■
    server/listen.c
    skipped 46 lines
    47 47   sock2 = accept(sock, (struct sockaddr *)NULL, NULL);
    48 48   if(sock2 < 0){
    49 49   perror("accept() socket failed!");
    50  - close(sock2);
     50 + close(sock);
    51 51   exit(1);
    52 52   }
    53 53   if(recv(sock2, recvbuf, sizeof(recvbuf), 0) < 0){
    skipped 11 lines
Please wait...
Page is in error, reload to recover