Is there a way to find an unused local port for when I create a client socket, or is trial and error?
-- P "Patrick" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Here's a general question and it came about when I went to create a > SSLServerSocket in JSS: > > How can I control what port is used by the socket returned by the accept > method? (As you all know, after the server accepts a client connection, it > creates a *brand new socket* which listens on *a brand new port*; this is so > the server can continue listening to more clinet connections on the original > socket...). > > Even in Sun's ServerSocket class, there seems to be no way... > > I know this is a fundamental socket programming issue, but I really never > paid much attention to this issue until recently when my NSS app had a > requirement for staying within a pre-determined range for dynamically > allocated ports when creating any new socket... > > -- P > >
