CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    May 2011
    Posts
    2

    Client accidently close when the server crash

    The steps to test the problem
    1. Open TCP Server
    2. Open TCP Client
    3. TCP Client sends data to Server.
    4. Close TCP Server and the client also crash without any notification

    Second wonderful test:
    1. Comment the following statement in Client.c (at line 168) and compile it
    Code:
    Writen( sockfd, data.send_buf, strlen( data.send_buf ), __FILE__, __LINE__ );
    2. Run TCP Server
    3. Run TCP Client (since no writen(), so response from server, it is OK)
    4. Close TCP Server
    5. A lot of rubbish from TCP Server.........




    I also posted the source code here.
    Compile TCP Server
    Code:
    gcc -Wall -lmcheck -g -Werror -lpthread -o server server.c
    Compile TCP Client
    Code:
    gcc -Wall -lmcheck -g -Werror -lpthread -o client Client.c lib/*.c
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured