The Missing Bit

How to kill a TCP socket under linux


To test the behavior of a web socket client writter in elixir, I was wondering how to force close a socket.

The solution is quite simple and reside in the ss command:

sudo ss -K dst dport = 1234

where the ip and port can be adjusted.

If you wish to comment or discuss this post, just mention me on Mastodon or Twitter.