Dennis,

Is your code basically providing a round-robin over the configured range
of sockets for new socket connection requests?

Is the intent to distribute new connection requests over that socket range
in order to keep from saturating the endpoint multiplexer discussed below?
 If so, then presumably you choose the number of ports to use based on the
expected maximum number of concurrent connections.

Or am I completely misunderstanding the intention of the code and the
relationship between the TCPServerEndpoint class and the underlying ports?

Thanks,
Bryan


On 11/11/13 1:04 PM, "Dennis Reedy" <dennis.re...@gmail.com> wrote:

>Hi Bryan,
>
>I've done this in the past by creating a custom ServiceSocketFactory [1]
>and using that when creating the TcpServerEnpoint:
>
>ServerSocketFactory factory = new PortRangeServerSocketFactory(start,
>end);
>TcpServerEndpoint.getInstance(address.getHostAddress(), 0, null, factory);
>
>HTH
>
>Dennis
>
>1. 
>https://github.com/dreedyman/Rio/blob/master/rio-platform/src/main/java/or
>g/rioproject/net/PortRangeServerSocketFactory.java
>
>
>On Nov 11, 2013, at 1208PM, Greg Trasuk <tras...@stratuscom.com> wrote:
>
>> 
>> Hi Bryan:
>> 
>> Yes, you can create multiple Exporters around one TcpServerEndpoint, so
>>you should be able to simply create an endpoint with the port you need,
>>and then use it multiple times.  There is a limit of 128 ³Sessions²
>>through the endpoint multiplexer.  I¹ve always been under the impression
>>that that limited the number of exporters that you could create, but
>>looking at the spec again just now, I suspect that¹s just the number of
>>simultaneous calls that can be in process.  I¹d have to look closer at
>>the ILFactory code to see if if closes the ³session² after a call
>>completes.
>> 
>> I¹m not aware of a succinct reference on this topic, so if you could
>>post results to the list, that would help out others.
>> 
>> Cheers,
>> 
>> Greg Trasuk.
>> 
>> On Nov 11, 2013, at 11:21 AM, Bryan Thompson <br...@systap.com> wrote:
>> 
>>> I would like to setup exporters used by both long-lived and relatively
>>>short lived objects in a manner that could be compatible with a
>>>firewall.  E.g., I would like to have river communicating only using
>>>some configured ports.  Is this as easy as specifying the port number
>>>explicitly for TcpServerEndpoint constructor [1]?  Can the same port be
>>>reused for each such constructor and the requests multiplexed over that
>>>port (JERI appears to support such multiplexing per [2]) ?  Is there a
>>>good reference that covers this topic (how to configure jini/river to
>>>work with statically configured firewalls)?
>>> 
>>> Thanks in advance,
>>> Bryan
>>> 
>>> [1] 
>>>https://river.apache.org/doc/api/net/jini/jeri/tcp/TcpServerEndpoint.htm
>>>l
>>> [2] 
>>>https://river.apache.org/doc/api/net/jini/jeri/connection/doc-files/mux.
>>>html
>> 
>

Reply via email to