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
2. Run TCP ServerCode:Writen( sockfd, data.send_buf, strlen( data.send_buf ), __FILE__, __LINE__ );
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
Compile TCP ClientCode:gcc -Wall -lmcheck -g -Werror -lpthread -o server server.c
Code:gcc -Wall -lmcheck -g -Werror -lpthread -o client Client.c lib/*.c




Reply With Quote