I have implemented two apps to run as server and client using stream sockets. It shares files from server app to multiple client apps when user is clicked on sharing option in Server app. I need to close sockets and socket listener when each operation is done. Sockets can be closed when each operations are competed.
There can be a scenario, Server app share only one file for the day. So I need to close the stream socket listener also.
What is best place to close the stream socket listener? Is there any best practice to follow.
Thanks in advance.