CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    99

    how do the computer know which process is listening to which port?

    hello guys,

    i have a basic and maybe stupid question. how do the computer know which process is listening to which port.

    for example i have several web browsers installed on my machine.

    and if i run firefox and ie at the same time, can my html request sent from firefox be captured by ie?

    i'm thinking of implementing a p2p forum system to deal with censorship. but if i choose to use some specific port, the system can be easily banned. but if i can use a port like 80, things could be better. after all, the government cannot ban all web browsing.

    thank you.

  2. #2
    Join Date
    May 2001
    Location
    Germany
    Posts
    1,158

    Re: how do the computer know which process is listening to which port?

    You must differentiate between clients and servers.

    A server listens to a well-known port, e. g. a web server usually listens to port 80. Each client that wants to connect to the server must know this port.

    A client connects to that port, using a (randomly chosen) local port (that does not really matter).

    Using 2 web browsers, like in your example, would lead to 2 connections, both completely independant.

    A connection is uniquely defined by the 5-tupel
    local-IP-address, local-port, remote-IP-address, remote-port, protocol.

    You thus may have 2 connections
    <your-local-IP-address>, 4000, <server-IP-address>, 80, TCP
    and
    <your-local-IP-address>, 4001, <server-IP-address>, 80, TCP
    for your 2 browsers.

  3. #3
    Join Date
    Oct 2008
    Location
    bhubaneswar
    Posts
    3

    Re: how do the computer know which process is listening to which port?

    u can know which process is using which port...

    use fport to kno...

    here goes the link
    http://techzonebyasit.blogspot.com/2008/07/fport.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured