fr.dyade.aaa.agent.StreamNetwork Class Reference

Inherits fr.dyade.aaa.agent.Network.

Inherited by fr.dyade.aaa.agent.HttpNetwork, fr.dyade.aaa.agent.NGNetwork, fr.dyade.aaa.agent.PoolNetwork, and fr.dyade.aaa.agent.SimpleNetwork.

Inheritance diagram for fr.dyade.aaa.agent.StreamNetwork:

Inheritance graph
[legend]
Collaboration diagram for fr.dyade.aaa.agent.StreamNetwork:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StreamNetwork ()
void init (String name, int port, short[] servers) throws Exception
void setProperties () throws Exception

Package Functions

final Socket createSocket (ServerDesc server) throws IOException
final Socket createSocket (SocketAddress addr) throws IOException
Socket createSocket (InetAddress addr, int port) throws IOException
final ServerSocket createServerSocket () throws IOException
ServerSocket createServerSocket (int port) throws IOException
void setSocketOption (Socket sock) throws SocketException

Package Attributes

int CnxRetry = 3
int backlog = 5
boolean TcpNoDelay = false
int SoLinger = -1
int SoTimeout = 0
int ConnectTimeout = 0
InetAddress inLocalAddr = null
int outLocalPort = 0
InetAddress outLocalAddr = null
SocketFactory socketFactory = null

Detailed Description

StreamNetwork is a base implementation of Network class for TCP sockets.

Definition at line 46 of file StreamNetwork.java.


Constructor & Destructor Documentation

fr.dyade.aaa.agent.StreamNetwork.StreamNetwork (  ) 

Creates a new Network component

Definition at line 168 of file StreamNetwork.java.


Member Function Documentation

void fr.dyade.aaa.agent.StreamNetwork.init ( String  name,
int  port,
short[]  servers 
) throws Exception

Initializes a new StreamNetwork component.

Parameters:
name The domain name.
port The listen port.
servers The list of servers directly accessible from this network interface.
See also:
Network

Reimplemented from fr.dyade.aaa.agent.Network.

Reimplemented in fr.dyade.aaa.agent.HttpNetwork, fr.dyade.aaa.agent.NGNetwork, and fr.dyade.aaa.agent.PoolNetwork.

Definition at line 182 of file StreamNetwork.java.

References fr.dyade.aaa.agent.Network.name, fr.dyade.aaa.agent.Network.port, and fr.dyade.aaa.agent.Network.servers.

void fr.dyade.aaa.agent.StreamNetwork.setProperties (  )  throws Exception

Set the properties of the network. Inherited from Network class, can be extended by subclasses.

Reimplemented from fr.dyade.aaa.agent.Network.

Reimplemented in fr.dyade.aaa.agent.PoolNetwork.

Definition at line 190 of file StreamNetwork.java.

References fr.dyade.aaa.agent.StreamNetwork.backlog, fr.dyade.aaa.agent.StreamNetwork.CnxRetry, fr.dyade.aaa.agent.StreamNetwork.ConnectTimeout, fr.dyade.aaa.agent.Network.domain, fr.dyade.aaa.util.SocketFactory.getFactory(), fr.dyade.aaa.agent.Network.getName(), fr.dyade.aaa.agent.StreamNetwork.inLocalAddr, fr.dyade.aaa.agent.Network.logmon, fr.dyade.aaa.agent.StreamNetwork.outLocalAddr, fr.dyade.aaa.agent.StreamNetwork.outLocalPort, fr.dyade.aaa.agent.StreamNetwork.socketFactory, fr.dyade.aaa.agent.StreamNetwork.SoLinger, fr.dyade.aaa.agent.StreamNetwork.SoTimeout, and fr.dyade.aaa.agent.StreamNetwork.TcpNoDelay.

Here is the call graph for this function:

final Socket fr.dyade.aaa.agent.StreamNetwork.createSocket ( ServerDesc  server  )  throws IOException [package]

This method creates and returns a socket connected to a specified server. It may be overloaded in subclass, in order to create particular subclasses of sockets.

Parameters:
server the server descriptor.
Returns:
a socket connected to a ServerSocket at the specified network address and port.
Exceptions:
IOException if the connection can't be established

Definition at line 270 of file StreamNetwork.java.

References fr.dyade.aaa.agent.Network.logmon.

Referenced by fr.dyade.aaa.agent.StreamNetwork.createSocket(), fr.dyade.aaa.agent.PoolNetwork.NetSession.localStart(), fr.dyade.aaa.agent.HttpNetwork.NetServerOut.open(), fr.dyade.aaa.agent.SimpleNetwork.NetServerOut.run(), and fr.dyade.aaa.agent.SimpleNetwork.NetServerOut.watchdog().

final Socket fr.dyade.aaa.agent.StreamNetwork.createSocket ( SocketAddress  addr  )  throws IOException [package]

This method creates and returns a socket connected to a ServerSocket at the specified socket address. If it fails it resets the address in order to take in account dynamic DNS.

Parameters:
addr the socket address.
Returns:
a socket connected to a ServerSocket at the specified network address and port.
Exceptions:
IOException if the connection can't be established

Definition at line 312 of file StreamNetwork.java.

References fr.dyade.aaa.agent.StreamNetwork.createSocket().

Here is the call graph for this function:

Socket fr.dyade.aaa.agent.StreamNetwork.createSocket ( InetAddress  addr,
int  port 
) throws IOException [package]

This method creates and returns a socket connected to a ServerSocket at the specified network address and port. It may be overloaded in subclass, in order to use particular implementation of sockets.

Due to polymorphism of both factories and sockets, different kinds of sockets can be used by the same application code. The sockets returned to the application can be subclasses of Socket, so that they can directly expose new APIs for features such as compression, security, or firewall tunneling.

Parameters:
addr the server address.
port the server port.
Returns:
a socket connected to a ServerSocket at the specified network address and port.
Exceptions:
IOException if the connection can't be established

Reimplemented in fr.dyade.aaa.agent.HttpsNetwork, and fr.dyade.aaa.agent.SSLNetwork.

Definition at line 341 of file StreamNetwork.java.

References fr.dyade.aaa.agent.StreamNetwork.ConnectTimeout, fr.dyade.aaa.util.SocketFactory.createSocket(), fr.dyade.aaa.agent.StreamNetwork.outLocalAddr, fr.dyade.aaa.agent.StreamNetwork.outLocalPort, fr.dyade.aaa.agent.Network.port, and fr.dyade.aaa.agent.StreamNetwork.socketFactory.

Here is the call graph for this function:

final ServerSocket fr.dyade.aaa.agent.StreamNetwork.createServerSocket (  )  throws IOException [package]

This method creates and returns a server socket which uses all network interfaces on the host, and is bound to the specified port.

Returns:
a server socket bound to the specified port.
Exceptions:
IOException for networking errors

Definition at line 357 of file StreamNetwork.java.

References fr.dyade.aaa.agent.StreamNetwork.CnxRetry, and fr.dyade.aaa.agent.Network.port.

Referenced by fr.dyade.aaa.agent.SimpleNetwork.NetServerIn.NetServerIn(), fr.dyade.aaa.agent.SimpleNetwork.NetServerIn.run(), fr.dyade.aaa.agent.PoolNetwork.WakeOnConnection.run(), fr.dyade.aaa.agent.HttpNetwork.start(), and fr.dyade.aaa.agent.PoolNetwork.WakeOnConnection.WakeOnConnection().

ServerSocket fr.dyade.aaa.agent.StreamNetwork.createServerSocket ( int  port  )  throws IOException [package]

This method creates and returns a server socket which uses all network interfaces on the host, and is bound to the specified port. It may be overloaded in subclass, in order to create particular subclasses of server sockets.

Parameters:
port the port to listen to.
Returns:
a server socket bound to the specified port.
Exceptions:
IOException for networking errors

Reimplemented in fr.dyade.aaa.agent.HttpsNetwork, and fr.dyade.aaa.agent.SSLNetwork.

Definition at line 381 of file StreamNetwork.java.

References fr.dyade.aaa.agent.StreamNetwork.backlog, fr.dyade.aaa.agent.StreamNetwork.inLocalAddr, and fr.dyade.aaa.agent.Network.port.

void fr.dyade.aaa.agent.StreamNetwork.setSocketOption ( Socket  sock  )  throws SocketException [package]

Configures this socket using the socket options established for this factory. It may be overloaded in subclass, in order to handle particular subclasses of sockets

Parameters:
Socket the socket.
Exceptions:
IOException for networking errors

Definition at line 394 of file StreamNetwork.java.

References fr.dyade.aaa.agent.StreamNetwork.SoLinger, fr.dyade.aaa.agent.StreamNetwork.SoTimeout, and fr.dyade.aaa.agent.StreamNetwork.TcpNoDelay.

Referenced by fr.dyade.aaa.agent.PoolNetwork.NetSession.localStart(), fr.dyade.aaa.agent.HttpNetwork.NetServerIn.open(), fr.dyade.aaa.agent.HttpNetwork.NetServerOut.open(), fr.dyade.aaa.agent.SimpleNetwork.NetServerIn.run(), fr.dyade.aaa.agent.SimpleNetwork.NetServerOut.run(), fr.dyade.aaa.agent.PoolNetwork.WakeOnConnection.run(), and fr.dyade.aaa.agent.SimpleNetwork.NetServerOut.watchdog().


Member Data Documentation

int fr.dyade.aaa.agent.StreamNetwork.CnxRetry = 3 [package]

Numbers of attempt to bind the server's socket before aborting, default value is 3. This value can be adjusted for all network components by setting CnxRetry global property or for a particular network by setting <DomainName>.CnxRetry specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 57 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.createServerSocket(), and fr.dyade.aaa.agent.StreamNetwork.setProperties().

int fr.dyade.aaa.agent.StreamNetwork.backlog = 5 [package]

The maximum queue length for incoming connection indications, default value is 5. This value can be adjusted for all network components by setting backlog global property or for a particular network by setting <DomainName>.backlog specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 68 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.createServerSocket(), fr.dyade.aaa.agent.SSLNetwork.createServerSocket(), fr.dyade.aaa.agent.HttpsNetwork.createServerSocket(), and fr.dyade.aaa.agent.StreamNetwork.setProperties().

boolean fr.dyade.aaa.agent.StreamNetwork.TcpNoDelay = false [package]

Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm), default value is false. This value can be adjusted for all network components by setting TcpNoDelay global property or for a particular network by setting <DomainName>.TcpNoDelay specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 79 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.setProperties(), and fr.dyade.aaa.agent.StreamNetwork.setSocketOption().

int fr.dyade.aaa.agent.StreamNetwork.SoLinger = -1 [package]

Enable SO_LINGER with the specified linger time in seconds, if the value is less than 0 then it disables SO_LINGER. Default value is -1. This value can be adjusted for all network components by setting SoLinger global property or for a particular network by setting <DomainName>.SoLinger specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 90 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.setProperties(), and fr.dyade.aaa.agent.StreamNetwork.setSocketOption().

int fr.dyade.aaa.agent.StreamNetwork.SoTimeout = 0 [package]

Enable/disable SO_TIMEOUT with the specified timeout in milliseconds. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout. Default value is 0. This value can be adjusted for all network components by setting SoTimeout global property or for a particular network by setting <DomainName>.SoTimeout specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 102 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.setProperties(), and fr.dyade.aaa.agent.StreamNetwork.setSocketOption().

int fr.dyade.aaa.agent.StreamNetwork.ConnectTimeout = 0 [package]

Defines in milliseconds the timeout used during socket connection. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout. Default value is 0. This value can be adjusted for all network components by setting ConnectTimeout global property or for a particular network by setting <DomainName>.ConnectTimeout specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 114 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.createSocket(), and fr.dyade.aaa.agent.StreamNetwork.setProperties().

InetAddress fr.dyade.aaa.agent.StreamNetwork.inLocalAddr = null [package]

The local address the listen ServerSocket is bound to. A null address will assign the wildcard address. Default value is null. This value can be adjusted for all network components by setting InLocalAddress global property or for a particular network by setting <DomainName>.InLocalAddress specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 126 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.createServerSocket(), fr.dyade.aaa.agent.SSLNetwork.createServerSocket(), fr.dyade.aaa.agent.HttpsNetwork.createServerSocket(), and fr.dyade.aaa.agent.StreamNetwork.setProperties().

int fr.dyade.aaa.agent.StreamNetwork.outLocalPort = 0 [package]

The local port the sockets are bound to. A valid port value is between 0 and 65535. A port number of zero will let the system pick up an ephemeral port in a bind operation. Default value is 0. This value can be adjusted for all network components by setting OutLocalPort global property or for a particular network by setting <DomainName>.OutLocalPort specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 139 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.createSocket(), fr.dyade.aaa.agent.SSLNetwork.createSocket(), fr.dyade.aaa.agent.HttpsNetwork.createSocket(), and fr.dyade.aaa.agent.StreamNetwork.setProperties().

InetAddress fr.dyade.aaa.agent.StreamNetwork.outLocalAddr = null [package]

The local address the sockets are bound to. A null address will assign the wildcard address. Default value is null. This value can be adjusted for all network components by setting OutLocalAddress global property or for a particular network by setting <DomainName>.OutLocalAddress specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Definition at line 151 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.createSocket(), fr.dyade.aaa.agent.SSLNetwork.createSocket(), fr.dyade.aaa.agent.HttpsNetwork.createSocket(), and fr.dyade.aaa.agent.StreamNetwork.setProperties().

SocketFactory fr.dyade.aaa.agent.StreamNetwork.socketFactory = null [package]

Allows to define a specific factory for socket in order to by-pass compatibility problem between JDK version. Currently there is two factories, The default factory one for JDK since 1.4, and "fr.dyade.aaa.util.SocketFactory13" for JDK prior to 1.4. This value can be adjusted for all network components by setting SocketFactory global property or for a particular network by setting <DomainName>.SocketFactory specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Reimplemented in fr.dyade.aaa.agent.HttpsNetwork, and fr.dyade.aaa.agent.SSLNetwork.

Definition at line 165 of file StreamNetwork.java.

Referenced by fr.dyade.aaa.agent.StreamNetwork.createSocket(), and fr.dyade.aaa.agent.StreamNetwork.setProperties().


The documentation for this class was generated from the following file:
Generated on Tue Sep 16 16:16:52 2008 for joram by  doxygen 1.5.0