Package org.jgroups.protocols
Class BasicTCP
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.TP
-
- org.jgroups.protocols.BasicTCP
-
-
Field Summary
Fields Modifier and Type Field Description protected java.net.InetAddress
client_bind_addr
protected int
client_bind_port
protected long
conn_expire_time
protected boolean
defer_client_bind_addr
protected int
linger
protected boolean
log_details
protected int
max_length
protected int
peer_addr_read_timeout
protected long
reaper_interval
protected int
recv_buf_size
protected int
send_buf_size
protected int
sock_conn_timeout
protected boolean
tcp_nodelay
protected boolean
use_acks
-
Fields inherited from class org.jgroups.protocols.TP
async_executor, bind_addr, bind_port, bundler, bundler_type, cluster_name, connectLock, diag_handler, external_addr, external_port, header, is_trace, last_discovery_request, LIST, local_physical_addr, local_transport, local_transport_class, log_discard_msgs, log_discard_msgs_version, logical_addr_cache, logical_addr_cache_expiration, logical_addr_cache_max_size, logical_addr_cache_reaper, logical_addr_cache_reaper_interval, loopback_copy, loopback_separate_thread, members, message_processing_policy, MIN_WAIT_BETWEEN_DISCOVERIES, msg_factory, msg_factory_class, MSG_OVERHEAD, msg_processing_policy, msg_stats, MULTICAST, port_range, print_function, receive_interfaces, receive_on_all_interfaces, rtt, socket_factory, suppress_log_different_cluster, suppress_log_different_version, suppress_time_different_cluster_warnings, suppress_time_different_version_warnings, thread_factory, thread_naming_pattern, thread_pool, time_service, time_service_interval, timer, timer_handle_non_blocking_tasks, use_virtual_threads, view, who_has_cache, who_has_cache_timeout
-
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BasicTCP()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
deferClientBindAddr()
BasicTCP
deferClientBindAddr(boolean d)
java.lang.Object
down(Event evt)
An event is to be sent down the stack.java.net.InetAddress
getClientBindAddr()
int
getClientBindPort()
long
getConnExpireTime()
java.lang.String
getInfo()
int
getLinger()
int
getMaxLength()
int
getPeerAddrReadTimeout()
long
getReaperInterval()
int
getRecvBufSize()
int
getSendBufSize()
int
getSockConnTimeout()
void
init()
Called after a protocol has been created and before the protocol is started.boolean
logDetails()
BasicTCP
logDetails(boolean l)
abstract java.lang.String
printConnections()
BasicTCP
reaperInterval(long interval)
abstract void
retainAll(java.util.Collection<Address> members)
abstract void
send(Address dest, byte[] data, int offset, int length)
void
sendUnicast(PhysicalAddress dest, byte[] data, int offset, int length)
Send a unicast to a member.BasicTCP
setClientBindAddr(java.net.InetAddress c)
BasicTCP
setClientBindPort(int c)
BasicTCP
setConnExpireTime(long time)
BasicTCP
setLinger(int l)
BasicTCP
setMaxLength(int len)
BasicTCP
setPeerAddrReadTimeout(int p)
BasicTCP
setReaperInterval(long interval)
BasicTCP
setRecvBufSize(int r)
BasicTCP
setSendBufSize(int s)
BasicTCP
setSockConnTimeout(int s)
boolean
supportsMulticasting()
Whether hardware multicasting is supportedboolean
tcpNodelay()
BasicTCP
tcpNodelay(boolean t)
boolean
useAcks()
BasicTCP
useAcks(boolean f)
-
Methods inherited from class org.jgroups.protocols.TP
_send, addPhysicalAddressToCache, addPhysicalAddressToCache, bundler, clearDifferentClusterCache, clearDifferentVersionCache, clearLogicalAddressCache, createBundler, createDiagnosticsHandler, defaultHeaders, destroy, disableDiagnostics, doSend, down, dumpTimerTasks, enableBlockingTimerTasks, enableDiagnostics, enableStats, evictLogicalAddressCache, evictLogicalAddressCache, fetchLocalAddresses, fetchPhysicalAddrs, fetchResponsesFromDiscoveryProtocol, getAllPhysicalAddressesFromCache, getAsyncExecutor, getBindAddr, getBindAddress, getBindPort, getBundler, getBundlerClass, getBundlerType, getClusterName, getClusterNameAscii, getDiagnosticsHandler, getDifferentClusterMessages, getDifferentVersionMessages, getExternalAddr, getExternalPort, getLocalPhysicalAddress, getLocalTransport, getLogDiscardMessages, getLogDiscardMessagesVersion, getLogicalAddrCacheExpiration, getLogicalAddrCacheMaxSize, getLogicalAddrCacheReaperInterval, getLogicalAddressCache, getMessageFactory, getMessageFactoryClass, getMessageProcessingPolicy, getMessageStats, getMsgFactoryClass, getNumberOfThreadDumps, getNumMcastMsgsReceived, getNumMcastMsgsSent, getNumRejectedMsgs, getNumThreads, getNumTimerTasks, getNumUcastMsgsReceived, getNumUcastMsgsSent, getPhysicalAddress, getPhysicalAddressFromCache, getPortRange, getReceiveInterfaces, getRTT, getSocketFactory, getSuppressTimeDifferentClusterWarnings, getSuppressTimeDifferentVersionWarnings, getThreadFactory, getThreadNamingPattern, getThreadPool, getTimer, getTimerClass, getTimerThreads, getTimeService, getTimeServiceInterval, getWhoHasCacheTimeout, handleConnect, handleDisconnect, handleMessageBatch, handleProbe, handleSingleMessage, isLogicalAddressCacheReaperRunning, isMulticastCapable, isReceiveOnAllInterfaces, isTrace, isTrace, localPhysicalAddress, logDiscardMsgs, logDiscardMsgs, logDiscardMsgsVersion, logDiscardMsgsVersion, loggerType, loopback, loopbackCopy, loopbackCopy, loopbackSeparateThread, loopbackSeparateThread, passBatchUp, passMessageUp, printLogicalAddressCache, printWhoHasCache, processBatch, receive, receive, receiveOnAllInterfaces, receiveOnAllInterfaces, registerLocalAddress, registerProbeHandler, removeCancelledTimerTasks, removeLogicalAddressFromCache, resetStats, sameCluster, sendTo, sendToAll, setAddress, setAsyncExecutor, setBindAddr, setBindAddress, setBindPort, setBindToAllInterfaces, setBundler, setBundlerType, setDiagnosticsHandler, setExternalAddr, setExternalPort, setInAllThreadFactories, setLevel, setLocalTransport, setLocalTransport, setLogDiscardMessages, setLogDiscardMessagesVersion, setLogicalAddrCacheExpiration, setLogicalAddrCacheMaxSize, setLogicalAddrCacheReaperInterval, setMessageFactory, setMessageProcessingPolicy, setMsgFactoryClass, setPortRange, setSocketFactory, setSourceAddress, setSuppressTimeDifferentClusterWarnings, setSuppressTimeDifferentVersionWarnings, setThreadFactory, setThreadNames, setThreadPool, setTimer, setTimeService, setTimeServiceInterval, setWhoHasCacheTimeout, start, startDiagnostics, stop, stopDiagnostics, supportedKeys, timestamp, toString, unicastDestMismatch, unregisterProbeHandler, unsetThreadNames, useVirtualThreads, useVirtualThreads, versionMatch, view
-
Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, down, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setPolicies, setProtocolStack, setUpProtocol, setValue, statsEnabled, up, up, up
-
-
-
-
Field Detail
-
reaper_interval
protected long reaper_interval
-
conn_expire_time
protected long conn_expire_time
-
recv_buf_size
protected int recv_buf_size
-
send_buf_size
protected int send_buf_size
-
sock_conn_timeout
protected int sock_conn_timeout
-
peer_addr_read_timeout
protected int peer_addr_read_timeout
-
max_length
protected int max_length
-
tcp_nodelay
protected boolean tcp_nodelay
-
linger
protected int linger
-
use_acks
protected boolean use_acks
-
client_bind_addr
protected java.net.InetAddress client_bind_addr
-
client_bind_port
protected int client_bind_port
-
defer_client_bind_addr
protected boolean defer_client_bind_addr
-
log_details
protected boolean log_details
-
-
Method Detail
-
supportsMulticasting
public boolean supportsMulticasting()
Description copied from class:TP
Whether hardware multicasting is supported- Specified by:
supportsMulticasting
in classTP
-
getReaperInterval
public long getReaperInterval()
-
setReaperInterval
public BasicTCP setReaperInterval(long interval)
-
reaperInterval
public BasicTCP reaperInterval(long interval)
-
getConnExpireTime
public long getConnExpireTime()
-
setConnExpireTime
public BasicTCP setConnExpireTime(long time)
-
getRecvBufSize
public int getRecvBufSize()
-
setRecvBufSize
public BasicTCP setRecvBufSize(int r)
-
getSendBufSize
public int getSendBufSize()
-
setSendBufSize
public BasicTCP setSendBufSize(int s)
-
getSockConnTimeout
public int getSockConnTimeout()
-
setSockConnTimeout
public BasicTCP setSockConnTimeout(int s)
-
getMaxLength
public int getMaxLength()
-
setMaxLength
public BasicTCP setMaxLength(int len)
-
getPeerAddrReadTimeout
public int getPeerAddrReadTimeout()
-
setPeerAddrReadTimeout
public BasicTCP setPeerAddrReadTimeout(int p)
-
tcpNodelay
public boolean tcpNodelay()
-
tcpNodelay
public BasicTCP tcpNodelay(boolean t)
-
getLinger
public int getLinger()
-
setLinger
public BasicTCP setLinger(int l)
-
useAcks
public boolean useAcks()
-
useAcks
public BasicTCP useAcks(boolean f)
-
getClientBindAddr
public java.net.InetAddress getClientBindAddr()
-
setClientBindAddr
public BasicTCP setClientBindAddr(java.net.InetAddress c)
-
getClientBindPort
public int getClientBindPort()
-
setClientBindPort
public BasicTCP setClientBindPort(int c)
-
deferClientBindAddr
public boolean deferClientBindAddr()
-
deferClientBindAddr
public BasicTCP deferClientBindAddr(boolean d)
-
logDetails
public boolean logDetails()
-
logDetails
public BasicTCP logDetails(boolean l)
-
init
public void init() throws java.lang.Exception
Description copied from class:Protocol
Called after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent.
-
sendUnicast
public void sendUnicast(PhysicalAddress dest, byte[] data, int offset, int length) throws java.lang.Exception
Description copied from class:TP
Send a unicast to a member. Note that the destination address is a *physical*, not a logical address- Specified by:
sendUnicast
in classTP
- Parameters:
dest
- Must be a non-null unicast addressdata
- The data to be sent. This is not a copy, so don't modify it- Throws:
java.lang.Exception
-
printConnections
public abstract java.lang.String printConnections()
-
send
public abstract void send(Address dest, byte[] data, int offset, int length) throws java.lang.Exception
- Throws:
java.lang.Exception
-
retainAll
public abstract void retainAll(java.util.Collection<Address> members)
-
down
public java.lang.Object down(Event evt)
Description copied from class:Protocol
An event is to be sent down the stack. A protocol may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the protocol may need to add a header to it (or do nothing at all) before sending it down the stack usingdown_prot.down()
.
-
-