+ $body_l = mb_strlen($body, "LATIN1");
+ $ret = @fwrite($sock, $body);
+ if ($ret < $body_l) {
+ printf("TROUBLE WITH FWRITE: %d\n", $ret);
+ $user->rd_cache_set(mb_substr($body, $ret, $body_l - $ret, "LATIN1"));
+ }
+ else {
+ $user->rd_cache_set("");
+ }