public class TUNNEL extends TP
router_host
and router_port
. All outgoing traffic is sent
via this TCP socket to the Router which distributes it to all connected TUNNELs in this group.
Incoming traffic received from Router will simply be passed up the stack.
A TUNNEL layer can be used to penetrate a firewall, most firewalls allow creating TCP connections to the outside world, however, they do not permit outside hosts to initiate a TCP connection to a host inside the firewall. Therefore, the connection created by the inside host is reused by Router to send traffic from an outside host to a host inside the firewall.
限定符和类型 | 类和说明 |
---|---|
class |
TUNNEL.StubReceiver |
static interface |
TUNNEL.TUNNELPolicy |
TP.BaseBundler, TP.BatchHandler, TP.Bundler, TP.MyHandler, TP.ProtocolAdapter, TP.SenderSendsBundler, TP.SenderSendsWithTimerBundler, TP.SingleMessageHandler, TP.TransferQueueBundler
avg_batch_size, bind_addr, bind_interface_str, bind_port, BUNDLE_MSG, bundler, bundler_capacity, bundler_type, can_bind_to_mcast_addr, cluster_name, connect_count, connectLock, default_thread_factory, diag_handler, diagnostics_addr, diagnostics_bind_interfaces, diagnostics_passcode, diagnostics_port, diagnostics_ttl, discard_incompatible_packets, enable_batching, enable_bundling, enable_diagnostics, enable_unicast_bundling, external_addr, external_port, f, global_thread_factory, header, ignore_dont_bundle, internal_thread_factory, internal_thread_pool, internal_thread_pool_enabled, internal_thread_pool_keep_alive_time, internal_thread_pool_max_threads, internal_thread_pool_min_threads, internal_thread_pool_queue, internal_thread_pool_queue_enabled, internal_thread_pool_queue_max_size, internal_thread_pool_rejection_policy, last_discovery_request, LIST, local_addr, local_physical_addr, log_discard_msgs, log_discard_msgs_version, logical_addr_cache, logical_addr_cache_expiration, logical_addr_cache_max_size, logical_addr_cache_reaper_interval, loopback, loopback_copy, loopback_separate_thread, max_bundle_size, max_bundle_timeout, members, MSG_OFFSET, MSG_OVERHEAD, MULTICAST, num_batches_received, num_batches_sent, num_bytes_received, num_bytes_sent, num_incoming_msgs_received, num_internal_msgs_received, num_msgs_received, num_msgs_sent, num_oob_msgs_received, num_rejected_msgs, num_single_msgs_received, num_single_msgs_sent, oob_thread_factory, oob_thread_pool, oob_thread_pool_enabled, oob_thread_pool_keep_alive_time, oob_thread_pool_max_threads, oob_thread_pool_min_threads, oob_thread_pool_queue, oob_thread_pool_queue_enabled, oob_thread_pool_queue_max_size, oob_thread_pool_rejection_policy, physical_addr_max_fetch_attempts, port_range, preregistered_probe_handlers, print_function, receive_interfaces, receive_on_all_interfaces, singleton_name, socket_factory, suppress_log_different_cluster, suppress_log_different_version, suppress_time_different_cluster_warnings, suppress_time_different_version_warnings, thread_naming_pattern, thread_pool, thread_pool_enabled, thread_pool_keep_alive_time, thread_pool_max_threads, thread_pool_min_threads, thread_pool_queue, thread_pool_queue_enabled, thread_pool_queue_max_size, thread_pool_rejection_policy, tick_time, time_service, time_service_interval, timer, timer_keep_alive_time, timer_max_threads, timer_min_threads, timer_queue_max_size, timer_rejection_policy, timer_thread_factory, timer_type, up_prots, wheel_size, who_has_cache, who_has_cache_timeout
构造器和说明 |
---|
TUNNEL() |
限定符和类型 | 方法和说明 |
---|---|
void |
destroy()
This method is called on a
Channel.close() . |
java.lang.String |
getInfo() |
protected PhysicalAddress |
getPhysicalAddress() |
long |
getReconnectInterval() |
java.lang.Object |
handleDownEvent(Event evt) |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
protected void |
send(Message msg,
Address dest)
Serializes and sends a message.
|
void |
sendMulticast(AsciiString cluster_name,
byte[] data,
int offset,
int length)
Send to all members in the group.
|
void |
sendUnicast(PhysicalAddress dest,
byte[] data,
int offset,
int length)
Send a unicast to 1 member.
|
void |
setGossipRouterHosts(java.lang.String hosts) |
void |
setReconnectInterval(long reconnect_interval) |
void |
setTUNNELPolicy(TUNNEL.TUNNELPolicy policy) |
boolean |
supportsMulticasting()
We can simply send a message with dest == null and the GossipRouter will take care of routing it to all
members in the cluster
|
java.lang.String |
toString() |
_send, addPhysicalAddressToCache, clearDifferentClusterCache, clearDifferentVersionCache, clearLogicalAddressCache, createThreadPool, disableDiagnostics, doSend, down, dumpTimerTasks, enableDiagnostics, evictLogicalAddressCache, evictLogicalAddressCache, fetchLocalAddresses, fetchPhysicalAddrs, fetchResponsesFromDiscoveryProtocol, getAllPhysicalAddressesFromCache, getAvgBatchSize, getBindAddress, getBindPort, getBundlerBufferSize, getClusterName, getClusterName, getDefaultThreadPool, getDefaultThreadPoolThreadFactory, getDifferentClusterMessages, getDifferentVersionMessages, getInternalMaxQueueSize, getInternalMessages, getInternalPoolSize, getInternalPoolSizeActive, getInternalQueueSize, getInternalThreadPool, getInternalThreadPoolThreadFactory, getLocalAddress, getLocalPhysicalAddress, getLogDiscardMessages, getLogDiscardMessagesVersion, getMaxBundleSize, getMaxBundleTimeout, getNumBytesReceived, getNumBytesSent, getNumMessagesReceived, getNumMessagesSent, getNumThreads, getNumTimerTasks, getOOBMaxQueueSize, getOOBMessages, getOOBPoolSize, getOOBPoolSizeActive, getOOBQueueSize, getOOBThreadPool, getOOBThreadPoolKeepAliveTime, getOOBThreadPoolMaxThreads, getOOBThreadPoolMinThreads, getOOBThreadPoolThreadFactory, getPhysicalAddressFromCache, getPortRange, getReceiveInterfaces, getRegularMaxQueueSize, getRegularMessages, getRegularPoolSize, getRegularPoolSizeActive, getRegularQueueSize, getSingletonName, getSocketFactory, getThreadFactory, getThreadNamingPattern, getThreadPoolKeepAliveTime, getThreadPoolMaxThreads, getThreadPoolMinThreads, getTimer, getTimerClass, getTimerKeepAliveTime, getTimerMaxThreads, getTimerMinThreads, getTimerQueueSize, getTimerThreadFactory, getTimerThreads, getTimeService, getUpProtocols, handleConnect, handleDisconnect, handleMessageBatch, handleProbe, handleSingleMessage, isDefaulThreadPoolEnabled, isDiagnosticsHandlerRunning, isDiscardIncompatiblePackets, isEnableBundling, isEnableUnicastBundling, isLogicalAddressCacheReaperRunning, isLoopback, isMulticastCapable, isOOBThreadPoolEnabled, isReceiveOnAllInterfaces, isSingleton, loggerType, loopback, passBatchUp, passMessageUp, passToAllUpProtocols, pickThreadPool, printLogicalAddressCache, printWhoHasCache, readMessage, readMessageBatch, readMessageList, receive, registerLocalAddress, registerProbeHandler, removeAndDispatchNonBundledMessages, removeLogicalAddressFromCache, resetStats, sendToMembers, sendToSingleMember, setBindAddress, setBindPort, setBindToAllInterfaces, setBundler, setDefaultThreadPool, setDefaultThreadPoolThreadFactory, setDiagnosticsHandler, setDiscardIncompatiblePackets, setEnableBundling, setEnableUnicastBundling, setInAllThreadFactories, setInternalThreadPool, setInternalThreadPoolThreadFactory, setLogDiscardMessages, setLogDiscardMessagesVersion, setLoopback, setMaxBundleSize, setMaxBundleTimeout, setOOBRejectionPolicy, setOOBThreadPool, setOOBThreadPoolKeepAliveTime, setOOBThreadPoolMaxThreads, setOOBThreadPoolMinThreads, setOOBThreadPoolQueueEnabled, setOOBThreadPoolThreadFactory, setPingData, setPortRange, setRegularRejectionPolicy, setSocketFactory, setSourceAddress, setThreadFactory, setThreadNames, setThreadPoolKeepAliveTime, setThreadPoolMaxThreads, setThreadPoolMinThreads, setThreadPoolQueueEnabled, setTimer, setTimerKeepAliveTime, setTimerMaxThreads, setTimerMinThreads, setTimerThreadFactory, setTimeService, shutdownThreadPool, start, startDiagnostics, stop, stopDiagnostics, supportedKeys, unregisterProbeHandler, unsetThreadNames, up, versionMatch, writeMessage, writeMessageList
accept, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setUpProtocol, setValue, setValues, statsEnabled, up
public boolean supportsMulticasting()
supportsMulticasting
在类中 TP
public void setGossipRouterHosts(java.lang.String hosts) throws java.net.UnknownHostException
java.net.UnknownHostException
public long getReconnectInterval()
public void setReconnectInterval(long reconnect_interval)
public void setTUNNELPolicy(TUNNEL.TUNNELPolicy policy)
public void init() throws java.lang.Exception
Protocol
public void destroy()
Protocol
Channel.close()
.
Does some cleanup; after the call the VM will terminatepublic java.lang.Object handleDownEvent(Event evt)
handleDownEvent
在类中 TP
protected void send(Message msg, Address dest) throws java.lang.Exception
TP
public void sendMulticast(AsciiString cluster_name, byte[] data, int offset, int length) throws java.lang.Exception
TP
sendMulticast
在类中 TP
cluster_name
- The name of the cluster. Null if not a shared transportdata
- The data to be sent. This is not a copy, so don't modify itjava.lang.Exception
public void sendUnicast(PhysicalAddress dest, byte[] data, int offset, int length) throws java.lang.Exception
TP
sendUnicast
在类中 TP
dest
- Must be a non-null unicast addressdata
- The data to be sent. This is not a copy, so don't modify itjava.lang.Exception
protected PhysicalAddress getPhysicalAddress()
getPhysicalAddress
在类中 TP