ggalan
10-15-2012, 07:14 PM
can anyone help me better understand socket connections please
if i have a socket connection like so
$address = gethostbyname('**.***.**.***');
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$result = socket_bind($socket, $address, '8000');
How can i have a particular file read this socket and how would i be able to pass strings or variables?
The concept i have is like cUrl.
In the example below i have the receive as receive.php
with $_GET variables
send:
$url = "http://mydomain.com/process.php?var=1";
$ch = curl_init($url);
curl_exec ($ch);
curl_close ($ch);
receive:
$var= $_GET['var'];
if i have a socket connection like so
$address = gethostbyname('**.***.**.***');
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$result = socket_bind($socket, $address, '8000');
How can i have a particular file read this socket and how would i be able to pass strings or variables?
The concept i have is like cUrl.
In the example below i have the receive as receive.php
with $_GET variables
send:
$url = "http://mydomain.com/process.php?var=1";
$ch = curl_init($url);
curl_exec ($ch);
curl_close ($ch);
receive:
$var= $_GET['var'];