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();
?>
write data including EOL (Previous) Net_Traceroute (Next)
Last updated: Sun, 31 Aug 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.