previousNet_Socket::writeLine() (Previous) (Next) Net_Traceroutenext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Example

Example – using Net_Socket

Example

Sending and recieving data

<?php
$socket 
= new Net_Socket() ;

// open connection
$socket->connect("http://www.example.com"80true30);

// Send data including linebreak
$socket->writeLine("String with data");

// receive data until linebreak
$result $socket->readLine();

// receive a number of data
$result $socket->read(512);

// close connection
$socket->disconnect();
?>
previousNet_Socket::writeLine() (Previous) (Next) Net_Traceroutenext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.