Skip to content

Instantly share code, notes, and snippets.

@kkumar-fk
Created July 23, 2019 03:46
Show Gist options
  • Save kkumar-fk/b4f477f7b1dfa66cd78ce1b710c6c4ad to your computer and use it in GitHub Desktop.
Save kkumar-fk/b4f477f7b1dfa66cd78ce1b710c6c4ad to your computer and use it in GitHub Desktop.
Output of
# Server is listening on port #45000
$ ss -tan | grep :45000
LISTEN 0 1 10.20.1.1:45000 *:*
# A client connects to the server using it's source port 54762. A new
# socket is created and is seen in ESTABLISHED state, along with the
# earlier LISTEN socket.
$ ss -tan | grep :45000
LISTEN 0 1 10.20.1.1:45000 *:*
ESTAB 0 0 10.20.1.1:45000 10.20.1.100:54762
# Kill the server application.
$ pkill -9 my_server
# Restart the server application.
$ ./my_server 45000
bind: Address already in use
# Find out why
$ ss -tan | grep :45000
TIME-WAIT 0 0 10.20.1.1:45000 10.20.1.100:54762
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment