How about:

Code:
alias sockopen {
  if $left($1,1) == - && $sock($2) != $null sockclose $2 | sockopen $1-
  elseif $sock($1) != $null sockclose $1 | sockopen $1-
}

alias socklisten {
  if $left($1,1) == - && $sock($2) != $null sockclose $2 | socklisten $1-
  elseif $sock($1) != $null sockclose $1 | socklisten $1-
}


That would make sure whenever you try to open an existing sock, that sock will be closed first, then opened-anew.

Good luck,
ziv.