C socket programming - port number inheritance.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sebouh
    New Member
    • Feb 2007
    • 77

    C socket programming - port number inheritance.

    Hi guys. I have a question about sockets. It appears that the accept function returns a socket descriptor after creating a new socket handler. This new handler inherits the properties of the socket passed to accept, including the bound port number.
    I was wondering if it's possible to change this port number so each socket uses it's own port.

    Thanks.
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by Sebouh
    Hi guys. I have a question about sockets. It appears that the accept function returns a socket descriptor after creating a new socket handler. This new handler inherits the properties of the socket passed to accept, including the bound port number.
    I was wondering if it's possible to change this port number so each socket uses it's own port.

    Thanks.

    Socket communication is confined to the port and a server will be l=listening in that port to accept connectons.
    I thinkit is better to open a new connection with different port and i dont think so you can change tghe port number of the accepted socket port

    Raghuram

    Comment

    • Sebouh
      New Member
      • Feb 2007
      • 77

      #3
      Originally posted by gpraghuram
      Socket communication is confined to the port and a server will be l=listening in that port to accept connectons.
      I thinkit is better to open a new connection with different port and i dont think so you can change tghe port number of the accepted socket port

      Raghuram
      So if a server communicates with multiple clients concurrently, it does so through the same port no matter what? Won't that create some sort of congestion?

      Comment

      • gpraghuram
        Recognized Expert Top Contributor
        • Mar 2007
        • 1275

        #4
        Originally posted by Sebouh
        So if a server communicates with multiple clients concurrently, it does so through the same port no matter what? Won't that create some sort of congestion?
        Then you may want to create a server listening at every port.
        Other members can comment on the idea

        Raghuram

        Comment

        Working...