public abstract class StreamNetwork extends Network
StreamNetwork
is a base implementation of Network
class for TCP sockets.Network.NetworkAverageLoadTask
Modifier and Type | Field and Description |
---|---|
(package private) int |
backlog
The maximum queue length for incoming connection indications,
default value is 5.
|
(package private) int |
CnxRetry
Numbers of attempt to bind the server's socket before aborting,
default value is 3.
|
(package private) int |
ConnectTimeout
Defines in milliseconds the timeout used during socket connection.
|
(package private) InetAddress |
inLocalAddr
The local address the listen ServerSocket is bound to.
|
(package private) InetAddress |
outLocalAddr
The local address the sockets are bound to.
|
(package private) int |
outLocalPort
The local port the sockets are bound to.
|
(package private) ServerSocketFactory |
serverSocketFactory
Allows to define a specific factory for ServerSocket in order to by-pass
compatibility problem between JDK version.
|
(package private) SocketFactory |
socketFactory
Allows to define a specific factory for Socket in order to by-pass
compatibility problem between JDK version.
|
(package private) int |
SoLinger
Enable SO_LINGER with the specified linger time in seconds, if the
value is less than 0 then it disables SO_LINGER.
|
(package private) int |
SoTimeout
Enable/disable SO_TIMEOUT with the specified timeout in milliseconds.
|
(package private) boolean |
TcpNoDelay
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm),
default value is false.
|
ALREADY_DELIVERED, averageLoadTask, bootTSFN, DELIVER, domain, idxLS, logmon, name, nbMessageIn, nbMessageOut, port, qout, servers, serversFN, sid, WDActivationPeriod, WDNbRetryLevel1, WDNbRetryLevel2, WDRetryPeriod1, WDRetryPeriod2, WDRetryPeriod3
Constructor and Description |
---|
StreamNetwork()
Creates a new Network component
|
Modifier and Type | Method and Description |
---|---|
(package private) ServerSocket |
createServerSocket()
This method creates and returns a server socket which uses all network
interfaces on the host, and is bound to the specified port.
|
(package private) ServerSocket |
createServerSocket(int port)
This method creates and returns a server socket which uses all network
interfaces on the host, and is bound to the specified port.
|
(package private) Socket |
createSocket(InetAddress addr,
int port)
This method creates and returns a socket connected to a ServerSocket
at the specified network address and port.
|
(package private) Socket |
createSocket(ServerDesc server)
This method creates and returns a socket connected to a
specified server.
|
(package private) Socket |
createSocket(SocketAddress addr)
This method creates and returns a socket connected to a ServerSocket at
the specified socket address.
|
void |
init(String name,
int port,
short[] servers)
Initializes a new StreamNetwork component.
|
void |
setProperties()
Set the properties of the network.
|
(package private) void |
setSocketOption(Socket sock)
Configures this socket using the socket options established for this
factory.
|
addServer, channelPostAndValidate, checkActive, delete, deleteMessage, deliver, delServer, getAverageLoad1, getAverageLoad15, getAverageLoad5, getBootTS, getDomainName, getMessageDest, getMessageSource, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getPort, getQueue, getStamp, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, index, insert, isPrior, post, postAndValidate, postMessage, prepareMessage, prepareMessageWithoutStamp, resetServer, restore, save, saveChannel, setMessageSource, setPort, setStamp, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3, testBootTS, testRecvUpdate, toString, validate, validateChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isRunning, start, stop
isRunning, start, stop
int CnxRetry
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.
int backlog
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.
boolean TcpNoDelay
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.
int SoLinger
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.
int SoTimeout
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.
int ConnectTimeout
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.
InetAddress inLocalAddr
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.
int outLocalPort
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.
InetAddress outLocalAddr
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.
ServerSocketFactory serverSocketFactory
ServerSocketFactory13
for JDK prior
to 1.4.
This value can be adjusted for all network components by setting
ServerSocketFactory
global property or for a particular
network by setting <DomainName>.ServerSocketFactory
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file.
SocketFactory socketFactory
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.
public void init(String name, int port, short[] servers) throws Exception
public void setProperties() throws Exception
setProperties
in class Network
Exception
- an error occurs.final Socket createSocket(ServerDesc server) throws IOException
server
- the server descriptor.IOException
- if the connection can't be establishedfinal Socket createSocket(SocketAddress addr) throws IOException
addr
- the socket address.IOException
- if the connection can't be establishedSocket createSocket(InetAddress addr, int port) throws IOException
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.
addr
- the server address.port
- the server port.IOException
- if the connection can't be establishedfinal ServerSocket createServerSocket() throws IOException
IOException
- for networking errorsServerSocket createServerSocket(int port) throws IOException
port
- the port to listen to.IOException
- for networking errorsvoid setSocketOption(Socket sock) throws SocketException
sock
- the socket.SocketException
- for networking errorsCopyright © 2023 ScalAgent D.T.. All rights reserved.