|
From: Bryan T. <br...@sy...> - 2010-09-08 12:31:52
|
I am also curious if there is a difference between an "ephemeral port" and a "free port". Ephemeral ports appear to be ports in a specific range (which might vary by the OS) and which are used for short lived service connections. If the service is to be long lived, should the free port be drawn from a different port range?
Thanks,
Bryan
> -----Original Message-----
> From: Bryan Thompson [mailto:br...@sy...]
> Sent: Wednesday, September 08, 2010 8:19 AM
> To: big...@li...
> Subject: [Bigdata-developers] How to configure the port and
> IP address for ServerSockets using NicUtil?
>
> Brian,
>
> I am wondering how we should construct and expose for
> configuration ServerSockets for custom data transfer
> services. Right now we have two such services which open
> ServerSockets to do NIO operations on ByteBuffers. These
> are the HA write replication pipeline and the ResourceService
> used to send shards around. I am currently extending the
> ResourceService to also ship around the intermediate results
> during distributed query evaluation.
>
> Reading the javadoc, it would appear that we should be using
> the following form of the ServerSocket contructor:
>
> public ServerSocket(int port, int backlog, InetAddress
> bindAddr) throws IOException;
>
> This allows us to specify the port (or pass 0 for a random
> port) and to specify the local IP address on which the
> service will communicate. The backlog can be specified as 0
> to use the default. For both of these services the port may
> be random since it will be disclosed by an RMI message, but
> it could also be nice to have the service talking on a
> configured port (for example, in order to simplify firewall
> configuration).
>
> It seems that the pattern in use right now to specify the
> INetAddress is:
>
> InetAddress.getByName(
> NicUtil.getIpAddress("default.nic"/*systemPropertyName*/,
> "default"/*defaultNicName*/, false/*loopback*/)
> );
>
> Presumably, the "default.nic" value could be replaced by the
> name of a different system property if we wanted to bind high
> volume data transfers onto a specific. It that is the
> intention, then perhaps we should define an alternative
> system property name for those cases and begin to use it at
> the appropriate locations in the code base.
>
> However, this still leaves unspecified a pattern to configure
> the port for the service. Would you envision a "PortUtil"
> (or an extension to NicUtil) which uses a similar pattern
> specifying the system property name and the default port name
> (or port number)?
>
> Thanks,
> Bryan
>
> --------------------------------------------------------------
> ----------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> Bigdata-developers mailing list
> Big...@li...
> https://lists.sourceforge.net/lists/listinfo/bigdata-developers
>
|