yep but you should put this code on sockopen event
Code:
  if ($sockerr) {
    echo -s error $sockname $sockerr $sock($sockname).wsmsg
    halt
  }


also

Code:
while ($sockbr > 0) {


it s not necessary because when $sockbr is 0 sockread will stop automaticly..

here is wrong;
Code:
tokenize 32 %r
    if stuff here..
    sockread %r


u should use tokenize command after sockread command u can't tokenize unripe %variable. Like this ;

Code:
    sockread %r
    tokenize 32 %r
    if stuff here..


i couldn't see other problem smirk i hope it ll work..


i like that