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

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

本文整理了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

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

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

  1. public void channelLookupTest() {
  2. when(mockChannel.getAddress()).thenReturn(a);
  3. when(mockChannel.down(isA(Event.class))).thenReturn(a);
  4. when(mockChannel.getView()).thenReturn(v);
  5. when(mockChannel.getProtocolStack()).thenReturn(ps);
  6. when(ps.getTransport()).thenReturn(new UDP());
  7. EmbeddedCacheManager cm = null;
  8. try {
  9. GlobalConfigurationBuilder gc = GlobalConfigurationBuilder.defaultClusteredBuilder();
  10. gc.transport().defaultTransport().addProperty("channelLookup", DummyLookup.class.getName());
  11. cm = TestCacheManagerFactory.createClusteredCacheManager(gc, new ConfigurationBuilder());
  12. cm.start();
  13. cm.getCache();
  14. GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(cm);
  15. Transport t = gcr.getComponent(Transport.class);
  16. assertNotNull(t);
  17. assertTrue(t instanceof JGroupsTransport);
  18. assertNotSame(JChannel.class, ((JGroupsTransport) t).getChannel().getClass());
  19. } finally {
  20. TestingUtil.killCacheManagers(cm);
  21. }
  22. }

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

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

相关文章