Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Cant understand the example...(URGENT)

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I was going through an example on socket programming with multi threading.
It has a socket server with multi threading implemented in it.
I fail to understand the following:
1. A listener port is opened on the server say 8888 where the server listens to the incoming requests,from which port does it send the response back to the client? Is it from the same listener port or does it open any other free port to send the response?
2.The example does not open any port explicitly on the client machine,so from which port does the client receive and send the requests?
3.I understand that the server is capable of handling multiple requests because of multithreadig although i cannot understand that how the requests and corrosponding responses are mapped that is how is the manupilation done that client receive the response to their request and not somebody elses response and who does this manupilation?
Basically i need to understand that whats going on behind the scenes for all these activities.
Will appreciate a detailed answer.
The example in question can be found at http://java.sun.com/docs/books/tutorial/networking/index.html.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't post the same query to multiple forums. Because this is mostly about sockets, I'm going to close this one and leave the one over there open.
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
    Bookmark Topic Watch Topic
  • New Topic