Archived

This topic is now archived and is closed to further replies.

Ejaz

what is the difference b/w Local & Remote Port?

Recommended Posts

Ejaz    122
Hi guys, Can anyone plz elaborate the difference b/w dwLocalPort & dwRemotePort while creating a direct play peer-peer application. I understand that its a very basic question, but I ''m a newbie, I try to search alot, but couldn''t get much information. What I got, how to use them in HostAddress & DeviceAddress, but what is the exact difference b/w them? Any help in this matter will be highly appriciated & thanx in advance. Regards, Ejaz.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I''m not sure about DirectPlay, but looking at it from a sockets point of view, I would say that the port numbers would describe the ports used in the end points of a network connection.

Take a connection where A connects to B - the endpoints are identified by an IP address and a port number. This information is needed by the network layer to know where to direct data up the layers of the protocol stack.

You shouldn''t really need this information because it is represented to you in your application by a socket which you simply use to send and receive data.

From a command prompt (or your console if you are using Linux) type netstat - you will see a list of connections which look something like this:

Proto Local Address Foreign Address State
TCP 192.168.1.1:2135 192.168.1.2:1541 ESTABLISHED

You can see the local and remote (foreign) IP addresses and port numbers.

Hope this helps

Share this post


Link to post
Share on other sites