Sorry, I completely missed that $sockerr was in your original test.

What is the output of /socklist when run during the on SOCKOPEN event? Does on SOCKCLOSE trigger?