UDP port question...?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
0perand
Forum Newbie
Posts: 9
Joined: Wed Oct 15, 2008 12:28 am

UDP port question...?

Post by 0perand »

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:

Code: Select all

 
$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);
 
I am not an expert by any means... So long explanations will help! Thanks!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: UDP port question...?

Post by requinix »

0perand
Forum Newbie
Posts: 9
Joined: Wed Oct 15, 2008 12:28 am

Re: UDP port question...?

Post by 0perand »

*** SOLVED ****

Thanks man works like a charm! Im an idiot for not finding it on my own lol.
Post Reply