Article View: borland.public.jbuilder.java.language
Article #748Re: port availability
From: John McGrath [TeamB]
Date: Sun, 07 Nov 2004 03:55
Date: Sun, 07 Nov 2004 03:55
19 lines
1481 bytes
1481 bytes
On 11/6/2004 at 3:28:19 PM, Alan Shiers wrote:
> i.e. ServerSocket socket = new ServerSocket(2500);
>
> Let's assume this port is already being used by another thread.
> Is there some way to check if the port is already active so that
> we can allocate a different port number or at least continue to
> check the port until it becomes free?
The constructor will throw an exception if the port is in use.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<xn0dpgfdz8cuc30009@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mailReferences:
<418d3dc6@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> User-Agent: XanaNews/1.16.4.6 Message-ID: <xn0dpgfdz8cuc30009@newsgroups.borland.com> X-Ref: newsgroups.borland.com ~XNS:00000033 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 141.158.57.49 Date: 6 Nov 2004 20:55:13 -0700 X-Trace: newsgroups.borland.com 1099803313 141.158.57.49 (6 Nov 2004 20:55:13 -0700) Lines: 19 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mail