org.apache.logging.log4j.core.net
Class TCPSocketManager
java.lang.Object
org.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.appender.OutputStreamManager
org.apache.logging.log4j.core.net.AbstractSocketManager
org.apache.logging.log4j.core.net.TCPSocketManager
public class TCPSocketManager
- extends AbstractSocketManager
Manager of TCP Socket connections.
|
Method Summary |
protected void |
close()
|
static TCPSocketManager |
getSocketManager(String host,
int port,
int delay)
Obtain a TCPSocketManager. |
protected void |
write(byte[] bytes,
int offset,
int length)
Some output streams synchronize writes while others do not. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_RECONNECTION_DELAY
public static final int DEFAULT_RECONNECTION_DELAY
- The default reconnection delay (30000 milliseconds or 30 seconds).
- See Also:
- Constant Field Values
TCPSocketManager
public TCPSocketManager(String name,
OutputStream os,
Socket sock,
InetAddress addr,
String host,
int port,
int delay)
- The Constructor.
- Parameters:
name - The unique name of this connection.os - The OutputStream.sock - The Socket.addr - The internet address of the host.host - The name of the host.port - The port number on the host.delay - Reconnection interval.
getSocketManager
public static TCPSocketManager getSocketManager(String host,
int port,
int delay)
- Obtain a TCPSocketManager.
- Parameters:
host - The host to connect to.port - The port on the host.delay - The interval to pause between retries.
- Returns:
- A TCPSocketManager.
write
protected void write(byte[] bytes,
int offset,
int length)
- Description copied from class:
OutputStreamManager
- Some output streams synchronize writes while others do not. Synchronizing here insures that
log events won't be intertwined.
- Overrides:
write in class OutputStreamManager
- Parameters:
bytes - The serialized Log event.offset - The offset into the byte array.length - The number of bytes to write.
close
protected void close()
- Overrides:
close in class OutputStreamManager
Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.