public function write ( $chunk ) {
			if( $this->write_finished ) { throw new InvalidOperationException( "Can not write, reading has started." ); }

			if( ! $this->write_started ) {
				fwrite( $this->socket, "\r\n" ); // Start message body
				$this->write_started = true;
			}
	
			fwrite( $this->socket, sprintf( "%x\r\n", strlen( $chunk ) ) );
			fwrite( $this->socket, $chunk );
			fwrite( $this->socket, "\r\n" );
			fflush( $this->socket );
		}
public function write ( $chunk ) {
			if( $this->write_finished ) { throw new InvalidOperationException( "Can not write, reading has started." ); }

			if( ! $this->write_started ) {
				fwrite( $this->socket, "\r\n" ); // Start message body
				$this->write_started = true;
			}
	
			fwrite( $this->socket, sprintf( "%x\r\n", strlen( $chunk ) ) );
			fwrite( $this->socket, $chunk );
			fwrite( $this->socket, "\r\n" );
			fflush( $this->socket );
		}
public function write ( $ chunk ) { if ( $ this -> write_finished ) { throw new InvalidOperationException ( "Can not write, reading has started." ) ; } if ( ! $ this -> write_started ) { fwrite ( $ this -> socket , "\r\n" ) ; // Start message body $ this -> write_started = true ; } fwrite ( $ this -> socket , sprintf ( "%x\r\n" , strlen ( $ chunk ) ) ) ; fwrite ( $ this -> socket , $ chunk ) ; fwrite ( $ this -> socket , "\r\n" ) ; fflush ( $ this -> socket ) ; }
Write a chunk of data
@param $chunk
Write a chunk of data