Close a frozen SSH session

Just a short one here, but I spend a lot of time using SSH to connect to a remote server and occassionally a session will freeze. Usually my solution is to close the terminal and start again, but there’s a neater way to just cancel the SSH session itself. Enter these keys, one after the other (not together):


That is, the enter key, the tilde, and a period. Your SSH session should close and you can re-open it without starting a new terminal.