Tcp programming under linux

just learned tcp programming under linux, and just successfully implemented a simple backfire client-server.

but there is a question: when the client finishes sending the file, it needs close (fd), so how can I tell the server that you can also close it?

my idea is to manually pass a special string to tell the server that you can also close, but I don"t know if this idea is correct?

Mar.06,2021

is actually not necessary to pass it manually. When the client calls close, the server will read EOF, and the server can close (if you no longer send data to the client)


after calling close, the client will send a FIN packet to the server, and the server ACK will also send a FIN packet to the client. The client will formally end the connection after sending ACK again. You do not need any additional operations in the application layer.
but: you only end this connection. In tcp, it is important to mark a connection as a quad (source address, source port, destination address, destination port), not to shut down the entire server .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45444-44b1d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45444-44b1d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?