org.eclipse.californium.core.coap.Request.getSenderIdentity()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(195)

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

Request.getSenderIdentity介绍

[英]Gets the authenticated (remote) sender's identity.
[中]获取经过身份验证的(远程)发件人的身份。

代码示例

代码示例来源:origin: eclipse/californium

@Test
public void testSenderIdentityIsAddedToIncomingRequest() throws Exception {
  Principal clientId = new Principal() {
    @Override
    public String getName() {
      return "Client";
    }
  };
  latch = new CountDownLatch(1);
  RawData inboundRequest = new RawData(getSerializedRequest(), new InetSocketAddress(CoAP.DEFAULT_COAP_PORT),
      clientId);
  connector.receiveMessage(inboundRequest);
  assertTrue(latch.await(2, TimeUnit.SECONDS));
  assertThat(receivedRequests.get(0).getSenderIdentity(), is(clientId));
}

代码示例来源:origin: eclipse/californium

assembled.setSenderIdentity(request.getSenderIdentity());
assembleMessage(status, assembled);

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

assembled.setSenderIdentity(request.getSenderIdentity());
assembleMessage(status, assembled);

相关文章