I haven't seen the "args out of range" error, but when I've had hangs after an interrupted connection I've been successful by killing the Tramp buffer for the protocol/host. It's generally named something like *tramp/scpc hostname*
. The next operation on the file buffer that requires communication reestablishes the connection.
This is really easy with ido-switch-buffer
because you can do it all in the mini-buffer - type a few letters to find the Tramp buffer and C-k to kill it.
An alternative (and perhaps cleaner) way to reset a connection is to use "M-x tramp-cleanup-this-connection":
tramp-cleanup-this-connection is an interactive autoloaded compiled Lisp function in `tramp-cmds.el'.
(tramp-cleanup-this-connection)
Flush all connection related objects of the current buffer's connection.
Also see "M-x tramp-cleanup-all-connections" and "M-x tramp-cleanup-all-buffers".