Article View: borland.public.jbuilder.java.language
Article #758Re: port availability
From: John McGrath [TeamB]
Date: Wed, 10 Nov 2004 00:56
Date: Wed, 10 Nov 2004 00:56
27 lines
2319 bytes
2319 bytes
On 11/9/2004 at 1:36:42 PM, Alan Shiers wrote:
> In my case port 5000. When a client logs on, a new thread is spawned.
> I get that already. My server app does exactly that. What I wanted
> to do next was assign port 5001 to another ServerSocket that every
> client uses to upload/download files. But as I said earlier, there
> may be times when more than one client is trying to upload/download
> files at the same time.
I still do not understand. Why not use a single port number for each
function? Why is there a need to dynamically assign a port?
The port assigned to a ServerSocket is only tied up while it is
establishing a connection. Multiple clients can connect to it and
establish connections, and those connections can be open at the
same time. If two clients try to connect at exactly the same time,
one of them will be queued up for a very short period of time until
the other client establishes its connection.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<xn0dpkicn35st2o00d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<418d3dc6@newsgroups.borland.com> <xn0dpgfdz8cuc30009@newsgroups.borland.com> <418e369d$1@newsgroups.borland.com> <xn0dphn9w893v7001@newsgroups.borland.com> <41910ec5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,deac63f97d065228 X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit From: "John McGrath [TeamB]" <ng-b@JPMcGrath.net> Subject: Re: port availability Newsgroups: borland.public.jbuilder.java.language References: <418d3dc6@newsgroups.borland.com> <xn0dpgfdz8cuc30009@newsgroups.borland.com> <418e369d$1@newsgroups.borland.com> <xn0dphn9w893v7001@newsgroups.borland.com> <41910ec5$1@newsgroups.borland.com> User-Agent: XanaNews/1.16.4.6 Message-ID: <xn0dpkicn35st2o00d@newsgroups.borland.com> X-Ref: newsgroups.borland.com ~XNS:00000043 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 151.197.214.103 Date: 9 Nov 2004 17:56:18 -0700 X-Trace: newsgroups.borland.com 1100051778 151.197.214.103 (9 Nov 2004 17:56:18 -0700) Lines: 27 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail