I am implementing a simple proxy application in which I always receive data from one end and send to the other end.
In such a case, once I am sure that I am done with receiving all the data from the incoming leg, can I call directly close( )
without calling shutdown( )
? If I do so, will close( )
ensure that all the data is delivered to the destination on the outgoing leg and received by the application at the destination?
Or in such a case, is it mandatory that I initiate a shutdown before I initiate a close?