ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Introduction to Socket Programming with PHP
Subject:   Socket Client problem
Date:   2003-01-30 04:40:58
From:   manjay_dwivedi
I am trying to write the socket client(which i want to run by browser).I am able to successfully connect to Socket server but i dont know how to send that data to server & read from server.Here is my code which do the connectivity part of it.can someone tell me the solution of this?


<?php
$host = "localhost";
$port = 10000;
$timeout = 45;


$fp = fsockopen($host, $port, $errno,
$errstr, $timeout);
if(!$fp)
{
echo $errstr . "Errno:" .
$errno . "<br>";
}
else
{
echo "socket successfully opened";


}
fclose($fp);
?>



THNX in advance
Manjay