In conclusion, you can only sockread to either a %variable or a &binvar, nothing else.
Well, you _could_ put anything in the sockread command, as long as it evaluates to the literal representation of a (binary) variable. Though that doesn't make it sockread to an alias, it sockreads to the return value of the alias, which is either a %variable or a &binvar.
alias sockvar return % $+ tmp
on *:sockread:mysocket:{
if ($sockerr) return
sockread $sockvar
echo -s -> %tmp
}
That will work, but what this does is simply first evaluate $sockvar to %tmp, and then do sockread %tmp. So you might as well put:
var %tmp
sockread %tmp
echo -s -> %tmp