Although one should always check there are data available before /sockreading, if you /sockread after emptying the receive buffer, mIRC will report there is data to be read, type /testsw :

Code:
alias testsw {
  sockclose testsw
  socklisten testsw 8005
  .timer 1 1 sockopen testsw2 127.0.0.1 8005
}
;sending two bytes, $crlf
on *:sockopen:testsw2:if (!$sockerr) sockwrite -n testsw2
on *:socklisten:testsw:if (!$sockerr) sockaccept testsw1
on *:sockread:testsw1:{
if (!$sockerr) {
var %a 
echo -a $sock($sockname).rq
sockread -f %a
echo -a $qt(%a) -- $ascii(%a)
sockread -f %a
echo -a $qt(%a) -- $ascii(%a)
sockclose testsw*
}
alias -l ascii returnex $regsubex($1-,/(*UTF8)(.)/g,$asc(\1) $+ $chr(32))


Quote:
2
"" --
"ea" -- 9 9 9 9 9 9 101 97


#mircscripting @ irc.swiftirc.net == the best mIRC help channel