> Also now I am confused and it will be helpful to know in asio sockets:
> 1. In what situation we need to use both
> "basic_stream_socket::shutdown()" & "basic_stream_socket::close()"
> functions?

If you want graceful closure of the socket, and you want it to work
consistently on Windows, use shutdown() before close(). There are
circumstances where just calling close() can result in the Windows TCP
stack sending a RST to the peer, which means possible data loss (i.e.
anything but a graceful closure).

> 2. In what situation we need to use just "basic_stream_socket::close()"
> function?

When you just want to close the connection as soon as possible and don't
care about possible loss of data under Windows.