socket_create UDP source port
Posted: Thu Apr 01, 2010 9:52 am
Hello everyone
I'd like to know if it is possible to put a source port
udp packet on create with socket_create.
With this code I have port 10000 destination but not source port.
Thank you for your help
Manu.07
I'd like to know if it is possible to put a source port
udp packet on create with socket_create.
Code: Select all
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$msg = "Message de moi";
$len = strlen($msg);
$ipadd = '192.168.0.1';
$port = '10000';
socket_sendto($sock, $msg, $len, 0, $ipadd, $port);
socket_close($sock);
With this code I have port 10000 destination but not source port.
Thank you for your help
Manu.07