• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SocketAddressImpl类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中io.vertx.core.net.impl.SocketAddressImpl的典型用法代码示例。如果您正苦于以下问题:Java SocketAddressImpl类的具体用法?Java SocketAddressImpl怎么用?Java SocketAddressImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SocketAddressImpl类属于io.vertx.core.net.impl包,在下文中一共展示了SocketAddressImpl类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Before
public void init() {
  new Expectations(CseContext.getInstance()) {
    {
      netSocket.remoteAddress();
      result = new SocketAddressImpl(new InetSocketAddress("127.0.0.1", 80));
    }
  };
  connection = new HighwayServerConnection();
  connection.init(netSocket);

  header = new RequestHeader();
}
 

开发者ID:apache,
项目名称:incubator-servicecomb-java-chassis,
代码行数:14,
代码来源:TestHighwayServerConnection.java

示例2: test

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Test
public void test() {
  MetricsServer
      .create(vertx())
      .apply(CollectorRegistry.defaultRegistry, ExpositionFormat.Text)
      .apply(new SocketAddressImpl(new InetSocketAddress(PORT)));

  await(response(body -> context().assertTrue(body.length() > 0, "Response is empty")));
}
 

开发者ID:nolequen,
项目名称:vertx-prometheus-metrics,
代码行数:10,
代码来源:ExternalServerTest.java

示例3: shouldDelegateGetRemoteAddress

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Test
public void shouldDelegateGetRemoteAddress() {
    when(httpServerRequest.remoteAddress())
        .thenReturn(null)
        .thenReturn(new SocketAddressImpl(8080, "10.3.100.108"));
    assertThat(vaadinRequest.getRemoteAddr()).isNull();
    assertThat(vaadinRequest.getRemoteAddr()).isEqualTo("10.3.100.108");
}
 

开发者ID:mcollovati,
项目名称:vaadin-vertx-samples,
代码行数:9,
代码来源:VertxVaadinRequestUT.java

示例4: connected

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Override
public SocketAddress connected(SocketAddress remoteAddress, String remoteName) {
  SocketAddress key = new SocketAddressImpl(remoteAddress.port(), remoteName);
  HttpClientConnectionsMeasurements measurements = connectionsMeasurements.get(key);
  if (measurements == null) {
    measurements = connectionsMeasurements.computeIfAbsent(key, address -> new HttpClientConnectionsMeasurements());
  }
  measurements.incrementConnections();
  return key;
}
 

开发者ID:vert-x3,
项目名称:vertx-hawkular-metrics,
代码行数:11,
代码来源:HttpClientMetricsImpl.java

示例5: testSocketAddressEquality

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Test
public void testSocketAddressEquality() {
  SocketAddress address1 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  SocketAddress address2 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  assertNotSame(address1, address2);
  assertEquals(address1, address2);
}
 

开发者ID:vert-x3,
项目名称:vertx-rx,
代码行数:8,
代码来源:EqualityTest.java

示例6: listening

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Override
public void listening(@NotNull String localName, @NotNull SocketAddress localAddress) {
  this.namedLocalAddress = new SocketAddressImpl(localAddress.port(), localName);
}
 

开发者ID:nolequen,
项目名称:vertx-prometheus-metrics,
代码行数:5,
代码来源:DatagramSocketPrometheusMetrics.java

示例7: shouldDelegateGetRemoteHost

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Test
public void shouldDelegateGetRemoteHost() {
    when(httpServerRequest.remoteAddress()).thenReturn(null, new SocketAddressImpl(5555, "10.1.1.1"));
    assertThat(vaadinRequest.getRemoteAddr()).isNull();
    assertThat(vaadinRequest.getRemoteAddr()).isEqualTo("10.1.1.1");
}
 

开发者ID:mcollovati,
项目名称:vaadin-vertx-samples,
代码行数:7,
代码来源:VertxVaadinRequestUT.java

示例8: shouldDelegateGetRemotePort

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Test
public void shouldDelegateGetRemotePort() {
    when(httpServerRequest.remoteAddress()).thenReturn(null, new SocketAddressImpl(5555, "10.1.1.1"));
    assertThat(vaadinRequest.getRemotePort()).isEqualTo(-1);
    assertThat(vaadinRequest.getRemotePort()).isEqualTo(5555);
}
 

开发者ID:mcollovati,
项目名称:vaadin-vertx-samples,
代码行数:7,
代码来源:VertxVaadinRequestUT.java

示例9: listening

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Override
public void listening(String localName, SocketAddress localAddress) {
  this.localAddress = new SocketAddressImpl(localAddress.port(), localName);
}
 

开发者ID:vert-x3,
项目名称:vertx-hawkular-metrics,
代码行数:5,
代码来源:DatagramSocketMetricsImpl.java

示例10: connected

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Override
public SocketAddress connected(SocketAddress remoteAddress, String remoteName) {
  SocketAddress key = new SocketAddressImpl(remoteAddress.port(), remoteName);
  connectionsMeasurements.computeIfAbsent(key, address -> new NetClientConnectionsMeasurements()).incrementConnections();
  return key;
}
 

开发者ID:vert-x3,
项目名称:vertx-hawkular-metrics,
代码行数:7,
代码来源:NetClientMetricsImpl.java

示例11: testSocketAddressToString

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Test
public void testSocketAddressToString() {
  io.vertx.core.net.SocketAddress socketAddress = new SocketAddressImpl(8888, "guest");
  SocketAddress rxSocketAddress = SocketAddress.newInstance(socketAddress);
  assertEquals(socketAddress.toString(), rxSocketAddress.toString());
}
 

开发者ID:vert-x3,
项目名称:vertx-rx,
代码行数:7,
代码来源:ToStringTest.java

示例12: testSocketAddressSet

点赞 2

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
@Test
public void testSocketAddressSet() {
  SocketAddress address1 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  SocketAddress address2 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  assertEquals(1, Stream.of(address1, address2).collect(toSet()).size());
}
 

开发者ID:vert-x3,
项目名称:vertx-rx,
代码行数:7,
代码来源:EqualityTest.java

示例13: getAddress

点赞 1

import io.vertx.core.net.impl.SocketAddressImpl; //导入依赖的package包/类
/**
 * Prometheus Metrics server address.
 *
 * @return server address
 */
public @NotNull SocketAddress getAddress() {
  return new SocketAddressImpl(port, host);
}
 

开发者ID:nolequen,
项目名称:vertx-prometheus-metrics,
代码行数:9,
代码来源:VertxPrometheusOptions.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)