Odd, SockOpen event shouldn't occur unless the socket was opened...

Use the command "/socklist" to view open sockets... Try $sockname instead of $socketname... Also check $sockerr is zero as the first line in *:sockread...
Code:
if ($sockerr) {
  echo -s SockError $sockname $sockerr
  return
}