Hi there,
I'm using php (the sockets extension) to handle sending and receiving xml files. I'd like to be able to fix the outgoing clients port number as the server has a set amount of incoming connections. I find that each time the php script is run it creates a new port number. The client side script I have so far is this:-
send_message('192.9.2.50','10220',$xmlCmd->asXML());
function send_message($ipaddr, $port, $msg)
{
$fp = stream_socket_client("tcp://".$ipaddr.":".$port, $errno, $errstr);
if (!$fp)
{
echo "ERR : $errno - $errstr";
}
else
{
fwrite($fp,$msg);
$response = fread($fp,1024);
// Make a SimpleXML object from the response
$xml = new SimpleXMLElement($response);
echo $xml->Channel->Air->Index;
fclose($fp);
}
}