I am a TCP/IP neophyte. I know just enough wireshark to muddle my way through a conversation, and am always looking to stretch that knowledge.
Below is a screenshot of a java program that simply opens and closes a socket. Right click and use the browsers “open image in new tab”, or whatever, to avoid the eyechart size graphic.
Note the SYN, SYN/ACK, SYN for the initial handshake. Also notice the FIN/ACK, FIN/ACK, ACK for the connection close.
This should be the general flow for connection setup and teardown.