org.jgroups.protocols.UDP.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中org.jgroups.protocols.UDP.<init>()方法的一些代码示例,展示了UDP.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UDP.<init>()方法的具体详情如下:
包路径:org.jgroups.protocols.UDP
类名称:UDP
方法名:<init>

UDP.<init>介绍

[英]Creates the UDP protocol, and initializes the state variables, does however not start any sockets or threads.
[中]创建UDP协议并初始化状态变量,但不会启动任何套接字或线程。

代码示例

代码示例来源:origin: wildfly/wildfly

public static void main(String[] args) throws Exception {
  Protocol[] prot_stack={
   new UDP().setValue("bind_addr", InetAddress.getByName("127.0.0.1")),
   new PING(),
   new MERGE3(),

代码示例来源:origin: org.infinispan/infinispan-core

public void channelLookupTest() {
 when(mockChannel.getAddress()).thenReturn(a);
 when(mockChannel.down(isA(Event.class))).thenReturn(a);
 when(mockChannel.getView()).thenReturn(v);
 when(mockChannel.getProtocolStack()).thenReturn(ps);
 when(ps.getTransport()).thenReturn(new UDP());
 EmbeddedCacheManager cm = null;
 try {
   GlobalConfigurationBuilder gc = GlobalConfigurationBuilder.defaultClusteredBuilder();
   gc.transport().defaultTransport().addProperty("channelLookup", DummyLookup.class.getName());
   cm = TestCacheManagerFactory.createClusteredCacheManager(gc, new ConfigurationBuilder());
   cm.start();
   cm.getCache();
   GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(cm);
   Transport t = gcr.getComponent(Transport.class);
   assertNotNull(t);
   assertTrue(t instanceof JGroupsTransport);
   assertNotSame(JChannel.class, ((JGroupsTransport) t).getChannel().getClass());
 } finally {
   TestingUtil.killCacheManagers(cm);
 }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public static void main(String[] args) throws Exception {
  Protocol[] prot_stack={
   new UDP().setValue("bind_addr", InetAddress.getByName("127.0.0.1")),
   new PING(),
   new MERGE3(),

相关文章