Once sockets are no longer of use they can be shut down or closed using the shutdown() or soclose() call. Typically, the shutdown() call is used if you want to shut down data transfer in one direction while keeping the other direction open. The soclose() call shuts down data transfer in both directions and then releases the resources associated with the socket.