0perand Posted October 15, 2008 Share Posted October 15, 2008 I am sending out udp packets at port 1900. I am using a packet sniffer to monitor the actual network activity. The information from the packet sniffer shows that the UDP packets are sent out a random ports in the 50000s and it goes to the correct ip address and port. My question is... How can you find out what port the udp packets were sent on? Here is the basic code: $Socket = socket_create(AF_INET,SOCK_DGRAM,SOL_UDP); socket_set_option($Socket,SOL_SOCKET, SO_REUSEADDR, 1); socket_bind($Socket,$IP_Address,$Port); socket_sendto($Socket,$soap_out,strlen($soap_out),0,$IP_Address,1900); Link to comment https://forums.phpfreaks.com/topic/128485-solved-udp-port-questionposted-tue-oct-14-2008-1034-pm/ Share on other sites More sharing options...
0perand Posted October 15, 2008 Author Share Posted October 15, 2008 socket_getsockname($Socket, $IP, $PORT); $PORT does have the correct port that the udp packet is being sent on. Link to comment https://forums.phpfreaks.com/topic/128485-solved-udp-port-questionposted-tue-oct-14-2008-1034-pm/#findComment-666159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.