http://www.perlmonks.org?node_id=11121731


in reply to packet_write_wait: Connection to xx.xx.xx.xx port 22: Broken pipe

packet_write_wait: Connection to xx.xx.xx.xx port 22: Broken pipe

That means the remote host has closed the connection. That is usually due to a timeout or some protocol interoperability issue.

You are not showing us any code, so it is difficult to give you more specific advice.