public class UDP extends TP
The following properties are read by the UDP protocol:
| 限定符和类型 | 类和说明 | 
|---|---|
class  | 
UDP.PacketReceiver  | 
TP.BaseBundler, TP.BatchHandler, TP.Bundler, TP.MyHandler, TP.ProtocolAdapter, TP.SenderSendsBundler, TP.SenderSendsWithTimerBundler, TP.SingleMessageHandler, TP.TransferQueueBundler| 限定符和类型 | 字段和说明 | 
|---|---|
protected boolean | 
disable_loopback  | 
protected static java.lang.reflect.Method | 
getImpl  | 
protected boolean | 
ip_mcast  | 
protected int | 
ip_ttl  | 
protected static boolean | 
is_android  | 
protected static boolean | 
is_mac  | 
protected IpAddress | 
mcast_addr
The multicast address (mcast address and port) this member uses 
 | 
protected java.net.InetAddress | 
mcast_group_addr  | 
protected int | 
mcast_port  | 
protected UDP.PacketReceiver | 
mcast_receiver
Runnable to receive multicast packets 
 | 
protected int | 
mcast_recv_buf_size  | 
protected int | 
mcast_send_buf_size  | 
protected java.net.MulticastSocket | 
mcast_sock
IP multicast socket for receiving multicast packets 
 | 
protected static java.lang.reflect.Method | 
setTimeToLive  | 
protected java.net.DatagramSocket | 
sock
Socket used for
 
 sending unicast and multicast packets and
 receiving unicast packets
 
 The address of this socket will be our local address (local_addr) 
 | 
protected SuppressLog<java.net.InetAddress> | 
suppress_log_out_of_buffer_space  | 
protected long | 
suppress_time_out_of_buffer_space  | 
protected int | 
tos
Traffic class for sending unicast and multicast datagrams. 
 | 
protected UDP.PacketReceiver | 
ucast_receiver
Runnable to receive unicast packets 
 | 
protected int | 
ucast_recv_buf_size  | 
protected int | 
ucast_send_buf_size  | 
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| 构造器和说明 | 
|---|
UDP()  | 
| 限定符和类型 | 方法和说明 | 
|---|---|
protected void | 
_send(java.net.InetAddress dest,
     int port,
     boolean mcast,
     byte[] data,
     int offset,
     int length)  | 
protected void | 
bindToInterfaces(java.util.List<java.net.NetworkInterface> interfaces,
                java.net.MulticastSocket s,
                java.net.InetAddress mcastAddr)  | 
void | 
clearDroppedMessagesCache()  | 
protected void | 
closeUnicastSocket()  | 
protected java.net.DatagramSocket | 
createDatagramSocketWithBindPort()
Creates a DatagramSocket when bind_port > 0. 
 | 
protected IpAddress | 
createLocalAddress()  | 
protected void | 
createSockets()
Creates the  UDP sender and receiver sockets 
 | 
void | 
destroy()
This method is called on a  
Channel.close(). | 
protected void | 
destroySockets()  | 
protected java.lang.String | 
dumpSocketInfo()  | 
protected static java.lang.reflect.Method | 
findMethod(java.lang.Class<?> clazz,
          java.lang.String method_name,
          java.lang.Class<?>... parameters)  | 
int | 
getDroppedMessage()  | 
java.lang.String | 
getInfo()  | 
java.net.InetAddress | 
getMulticastAddress()  | 
int | 
getMulticastPort()  | 
int | 
getMulticastTTL()
Getter for current multicast TTL 
 | 
protected PhysicalAddress | 
getPhysicalAddress()  | 
protected void | 
handleConfigEvent(java.util.Map<java.lang.String,java.lang.Object> map)  | 
protected void | 
handleConnect()  | 
protected void | 
handleDisconnect()  | 
protected java.lang.Object | 
handleDownEvent(Event evt)  | 
void | 
init()
Called after instance has been created (null constructor) and before protocol is started. 
 | 
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. 
 | 
protected void | 
setBufferSize(java.net.DatagramSocket sock,
             int send_buf_size,
             int recv_buf_size)  | 
void | 
setMaxBundleSize(int size)  | 
void | 
setMcastPort(int mcast_port)  | 
void | 
setMulticastAddress(java.net.InetAddress addr)  | 
void | 
setMulticastPort(int mcast_port)  | 
void | 
setMulticastTTL(int ttl)
Set the ttl for multicast socket 
 | 
protected void | 
setTimeToLive(int ttl)  | 
void | 
start()
Creates the unicast and multicast sockets and starts the unicast and multicast receiver threads 
 | 
void | 
stop()
This method is called on a  
Channel.disconnect(). | 
boolean | 
supportsMulticasting()
Whether or not hardware multicasting is supported 
 | 
_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, 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, send, sendToMembers, sendToSingleMember, setBindAddress, setBindPort, setBindToAllInterfaces, setBundler, setDefaultThreadPool, setDefaultThreadPoolThreadFactory, setDiagnosticsHandler, setDiscardIncompatiblePackets, setEnableBundling, setEnableUnicastBundling, setInAllThreadFactories, setInternalThreadPool, setInternalThreadPoolThreadFactory, setLogDiscardMessages, setLogDiscardMessagesVersion, setLoopback, 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, startDiagnostics, stopDiagnostics, supportedKeys, toString, unregisterProbeHandler, unsetThreadNames, up, versionMatch, writeMessage, writeMessageListaccept, 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, upprotected int tos
DatagramSocket.setTrafficClass(int) ); for details):
 IPTOS_LOWCOST (0x02), decimal 2IPTOS_RELIABILITY (0x04)<, decimal 4/LI>
 IPTOS_THROUGHPUT (0x08), decimal 8IPTOS_LOWDELAY (0x10), decimal 16protected java.net.InetAddress mcast_group_addr
protected int mcast_port
protected boolean ip_mcast
protected int ip_ttl
protected int mcast_send_buf_size
protected int mcast_recv_buf_size
protected int ucast_send_buf_size
protected int ucast_recv_buf_size
protected boolean disable_loopback
protected long suppress_time_out_of_buffer_space
protected IpAddress mcast_addr
protected java.net.DatagramSocket sock
protected java.net.MulticastSocket mcast_sock
protected UDP.PacketReceiver mcast_receiver
protected UDP.PacketReceiver ucast_receiver
protected SuppressLog<java.net.InetAddress> suppress_log_out_of_buffer_space
protected static final boolean is_android
protected static final boolean is_mac
protected static final java.lang.reflect.Method getImpl
protected static final java.lang.reflect.Method setTimeToLive
public boolean supportsMulticasting()
TPsupportsMulticasting 在类中 TPpublic void setMulticastAddress(java.net.InetAddress addr)
public java.net.InetAddress getMulticastAddress()
public int getMulticastPort()
public void setMulticastPort(int mcast_port)
public void setMcastPort(int mcast_port)
public void setMulticastTTL(int ttl)
ttl - the time to live for the socket.java.io.IOExceptionpublic int getMulticastTTL()
public void setMaxBundleSize(int size)
setMaxBundleSize 在类中 TPpublic int getDroppedMessage()
public void clearDroppedMessagesCache()
public void sendMulticast(AsciiString cluster_name, byte[] data, int offset, int length) throws java.lang.Exception
TPsendMulticast 在类中 TPcluster_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.Exceptionpublic void sendUnicast(PhysicalAddress dest, byte[] data, int offset, int length) throws java.lang.Exception
TPsendUnicast 在类中 TPdest - Must be a non-null unicast addressdata - The data to be sent. This is not a copy, so don't modify itjava.lang.Exceptionprotected void _send(java.net.InetAddress dest,
         int port,
         boolean mcast,
         byte[] data,
         int offset,
         int length)
              throws java.lang.Exception
java.lang.Exceptionprotected java.lang.Object handleDownEvent(Event evt)
handleDownEvent 在类中 TPpublic void init()
          throws java.lang.Exception
Protocolpublic void start()
           throws java.lang.Exception
start 在类中 TPjava.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
                   to fail, so Channel.connect(String) will throw an exceptionpublic void stop()
ProtocolChannel.disconnect(). Stops work (e.g. by closing multicast socket).
 Will be called from top to bottom. This means that at the time of the method invocation the
 neighbor protocol below is still working. This method will replace the
 STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
 when this method is called all messages in the down queue will have been flushedpublic void destroy()
ProtocolChannel.close().
 Does some cleanup; after the call the VM will terminateprotected void handleConnect()
                      throws java.lang.Exception
handleConnect 在类中 TPjava.lang.Exceptionprotected void handleDisconnect()
handleDisconnect 在类中 TPprotected static java.lang.reflect.Method findMethod(java.lang.Class<?> clazz,
                                  java.lang.String method_name,
                                  java.lang.Class<?>... parameters)
protected void setTimeToLive(int ttl)
protected void createSockets()
                      throws java.lang.Exception
java.lang.Exceptionprotected void destroySockets()
protected IpAddress createLocalAddress()
protected PhysicalAddress getPhysicalAddress()
getPhysicalAddress 在类中 TPprotected void bindToInterfaces(java.util.List<java.net.NetworkInterface> interfaces,
                    java.net.MulticastSocket s,
                    java.net.InetAddress mcastAddr)
interfaces - Lists - mcastAddr - java.io.IOExceptionprotected java.net.DatagramSocket createDatagramSocketWithBindPort()
                                                            throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String dumpSocketInfo()
                                   throws java.lang.Exception
java.lang.Exceptionprotected void setBufferSize(java.net.DatagramSocket sock,
                 int send_buf_size,
                 int recv_buf_size)
protected void closeUnicastSocket()
protected void handleConfigEvent(java.util.Map<java.lang.String,java.lang.Object> map)