Yes. Two programs talking to each other must follow some sort of protocol for how that communication should happen. The protocol does not need to be a standard or a formal (as in published, or even written down) protocol, but they must somehow agree on by what means and in what order they should communicate, and what the data that they pass to each other mean.
An analogy is a person exiting a grocery shop by paying for their goods at a check-out counter. There is an agreement of protocol there, and it includes an informal agreement regarding things like what language to use and what currency the monetary transaction should be done in. The protocol also says in what order things need to happen for the person to be able to later exit the store (legally) with the newly bought groceries. This protocol also involves exchange of information necessary for the person to choose whether they are paying using cash or a debit card. Asking to pay with anything else, or asking to pay too early or too late during the check-out process will confuse the person behind the counter, as would speaking in an unknown (incompatible) language.
Sometimes, you break that protocol by wanting to pay by cash at a card-only check-out till. You will then have restart the procedure at a counter that accepts cash. This information was given to you in an early transaction message (a sign saying "debit cards only") that you ignored.
You can see some examples of the protocol messages being sent back and forth between server and client when connecting to an SSH server by ssh
using -vvv
. On the client side, you will see messages about identifying the remote server's SSH protocol version and sending our own client version. There will be messages about agreeing on what ciphers to use and what authentication methods are attempted etc. You may also see the corresponding server side messages if you start the SSH daemon in debug mode and connect to it with a client.
socket
... not to be confused with the man page of "socket()" ... one example is a one line:socket -wslqvp "echo Socket! " 1938
... for the server, and then connect via:socket -v localhost 1938
... which outputsSocket!
and exits.