× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Peter,

I'm a little rusty myself....

But I'm pretty sure the answer is no, for TCP.

If I'm recalling correctly, you can time out trying to read from a connected
TCP socket, but there isn't a time out when you are listening for a
connection request.

There usually isn't a need for the same application to listen on more than
one port. As the port you are listening on is usually used just to receive
the connection request. The connection is then usually opened between the
requester and requestee on a random port.

UDP is a little different, since connections aren't used. UDP doesn't
"listen" till you call DatagramSocket.receive(). You can time that out.

I guess my point to the OP is that an application only listens on explicitly
specified ports.

HTH,
Charles


On Thu, Jun 25, 2009 at 1:33 PM, Peter Dow <maillist@xxxxxxxxxxxxxxx> wrote:

Hi Charles,

I'm kind of ignorant in this area, but isn't it possible to have a
timeout when listening on a port, like you can with a data queue? Then
the program could listen to 1 port for say 500ms, and if nothing
arrived, listen on the other port for 500ms, etc.

*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
pdow@xxxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxxx> /

Charles Wilt wrote:
On Wed, Jun 24, 2009 at 5:34 PM, Blalock, Bill <Bill.Blalock@xxxxxxxx
wrote:


My thought was to use security manager to

- allow it to listen only on port 3111

- allow it only to accept connections from a list of desktop
client names in the policy file



Bill,

Not familiar with Security manager, but thought I'd point out that an
applications (thread) can only listen on specific one port regardless.

If you wanted an application to listen on two ports, for instance one
unsecured and one secured like http does, you'd have to have two separate
threads running; each listening to a specific port.

Charles

--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.