thanks alot mate.

and on the sockopen isnt this better?

if ($Sockerr) {
echo error $Sockname $Sockerr $sock($Sockname).wsmsg
halt
}