function write($socket,$buf) {
		for ($i=0,$bytes=0;$i<strlen($buf);$i+=$bytes) {
			if (($bytes=@fwrite($socket,substr($buf,$i))) &&
				@fflush($socket))
				continue;
			if (isset($this->events['error']) &&
				is_callable($func=$this->events['error']))
				$func($this);
			$this->close($socket);
			return FALSE;
		}
		return $bytes;
	}
function write($socket,$buf) {
		for ($i=0,$bytes=0;$i<strlen($buf);$i+=$bytes) {
			if (($bytes=@fwrite($socket,substr($buf,$i))) &&
				@fflush($socket))
				continue;
			if (isset($this->events['error']) &&
				is_callable($func=$this->events['error']))
				$func($this);
			$this->close($socket);
			return FALSE;
		}
		return $bytes;
	}
function write ( $ socket , $ buf ) { for ( $ i = 0 , $ bytes = 0 ; $ i < strlen ( $ buf ) ; $ i += $ bytes ) { if ( ( $ bytes = @ fwrite ( $ socket , substr ( $ buf , $ i ) ) ) && @ fflush ( $ socket ) ) continue ; if ( isset ( $ this -> events [ 'error' ] ) && is_callable ( $ func = $ this -> events [ 'error' ] ) ) $ func ( $ this ) ; $ this -> close ( $ socket ) ; return FALSE ; } return $ bytes ; }
Write to stream socket
@return int|FALSE
@param $socket resource
@param $buf string
Write to stream socket