Re: Java Socket Programming



On 31 Mar 2006 08:38:31 -0800, Ravi wrote:
I understood your explanation. I think his question is in such a way
that if the serversocket listens in single port 8000.
But how all sockets connected to the same listened port handles the
information passing into that port.

The sockets are different in more aspects than just the port number.
Traffic arriving to the interface is dispatched by the network stack
based on the *combination* of local address, local port, remote
address and remote port. The port number alone does *not* identify the
socket or the connection.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.



Relevant Pages

  • Re: network programming: how does s.accept() work?
    ... The program you contact at Google is a server. ... so, the server will usually assign a new port, say 56399, specifically ... connections to a server remain on the same port, ... sockets is what identifies them. ...
    (comp.lang.python)
  • Re: Socket switch delay
    ... hadn't realized the bit about the completion port... ... > can come back with partial buffers from a completion io. ... > in the client and server. ... > remember changing in the server was the "non-blocking sockets" together ...
    (microsoft.public.win32.programmer.networks)
  • Re: security risk of having a long list of services in inetd
    ... for connections on certain internet sockets. ... the string 'ssh' means TCP port 22. ... But if there's no program sitting there listening on the port there's ...
    (Debian-User)
  • Re: Router/Firewall Port Mapping Question
    ... Sockets on the PC can be client or servers. ... The port number is usually selected by the ... and a Server on the other. ...
    (comp.security.firewalls)
  • Re: Maximum sockets
    ... "Phil Frisbie, Jr." ... > you call connectWindows assigns it to a unused port. ... > connect and close less than 3976 sockets every two minutes. ... I thought the WSAEADDRINUSE error occurred only when a connection was ...
    (microsoft.public.win32.programmer.networks)