I created a multi-server situation, where I'm copying files over SSH2 from the master server to a few slave servers.
I'm using PHP SSH2 with and although it works well, I don't understand why I don't need to CLOSE the connection. Nowhere in the PHP documentation (PHP NET) there's any mention of that.
Am I somehow going to be hogging resources or connections or something?
The code I'm using now is:
foreach ($hosts as $host) {
$conn = ssh2_connect($host, 22, array('hostkey'=>'ssh-rsa'));
ssh2_auth_pubkey_file(
$conn,
"transfer",
'/home/transfer/.ssh/rsa_id.pub',
'/home/transfer/.ssh/rsa_id'
);
foreach ($files as $file) ssh2_scp_send($conn, $file, $file, 0644);
}