Forcefully Closing TCP Connections in Golang

Benjamin Cane
ITNEXT
Published in
7 min readSep 7, 2021

--

Photo by Jose Antonio Gallego Vázquez on Unsplash

Working with TCP servers is a great way to become familiar with low-level network communications. When writing applications that communicate directly over TCP sockets a multitude of socket management steps are required. Actions that you typically don’t have to take for a typical HTTP-based application.

Sometimes, those extra management steps include having to close a TCP session…

--

--

Builder of payments systems at American Express & Open-source contributor. Follow me: https://www.linkedin.com/in/bencane/