write() public method

Writes to the socket.
public write ( string $data = null ) : boolean
$data string Data to write.
return boolean Success
Example #1
0
	public function testWriteAndRead() {
		$stream = new Context($this->_testConfig);
		$this->assertTrue(is_resource($stream->open()));
		$this->assertTrue(is_resource($stream->resource()));
		$this->assertEqual(1, $stream->write());
		$this->assertPattern("/^HTTP/", (string) $stream->read());
	}