Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Limiting number of ports in VM to a range

Reply
Thread Tools

Limiting number of ports in VM to a range

 
 
Hung
Guest
Posts: n/a
 
      02-27-2007
Hi there,

Trying to setup a vm server which accepts incoming connections. Is
there a way of limiting the range of clients ports used by the vm
during the connection creation with the connecting clients?

I've looked at SocketPermissions, it looks like what I want...but
not 100% sure.

 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      02-27-2007
On 27 Feb 2007 09:55:28 -0800, Hung wrote:
> Trying to setup a vm server which accepts incoming connections. Is
> there a way of limiting the range of clients ports used by the vm
> during the connection creation with the connecting clients?


No, you need to accept all incoming connections, but you can close the
ones you don't like based (for example) on Socket.getPort(). I wonder
however what added value this has, considering the complexity it adds
to the client.

The only thing similar to what you are asking is to bind your
ServerSocket to a specific local address, which lets you restrict what
network your clients can connect from.

/gordon

--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
 
 
 
Hung
Guest
Posts: n/a
 
      02-27-2007
Sorry, I really meant the socket created via the accept() of the
connection from the client application.
So the socket on the same vm running the serversocket.


On Feb 27, 1:24 pm, Gordon Beaton <(E-Mail Removed)> wrote:
> On 27 Feb 2007 09:55:28 -0800, Hung wrote:
>
> > Trying to setup a vm server which accepts incoming connections. Is
> > there a way of limiting the range of clients ports used by the vm
> > during the connection creation with the connecting clients?

>
> No, you need to accept all incoming connections, but you can close the
> ones you don't like based (for example) on Socket.getPort(). I wonder
> however what added value this has, considering the complexity it adds
> to the client.
>
> The only thing similar to what you are asking is to bind your
> ServerSocket to a specific local address, which lets you restrict what
> network your clients can connect from.
>
> /gordon
>
> --
> [ don't email me support questions or followups ]
> g o r d o n + n e w s @ b a l d e r 1 3 . s e



 
Reply With Quote
 
Gordon Beaton
Guest
Posts: n/a
 
      02-27-2007
On 27 Feb 2007 10:28:25 -0800, Hung wrote:
> Sorry, I really meant the socket created via the accept() of the
> connection from the client application. So the socket on the same vm
> running the serversocket.


Every Socket returned by ServerSocket.accept() uses the *same* local
port as the ServerSocket it came from.

Maybe you could try to describe what problem you're trying to solve,
instead of how you hope to solve it.

/gordon

--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Type of actual ports is not compatible with type of ports of entity. mreister VHDL 1 05-25-2010 11:30 AM
6500: User-Based Rate Limiting AND Total Rate Limiting Patrick Cervicek Cisco 0 08-07-2007 03:07 PM
Recommendations Please for a PCI card w/ two USB 2 Ports and FireWaire Ports Mike Digital Photography 27 02-26-2006 12:54 AM
Limiting number of ARP entries for 802.1q subinterfaces Everton Cisco 1 09-15-2005 01:47 PM
rate-limiting on only certain ports... Captain Cisco 1 04-05-2004 05:58 PM



Advertisments