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: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.