Package ch.ethz.inf.vs.californium.network

Examples of ch.ethz.inf.vs.californium.network.CoAPEndpoint


    request.setURI(uri);
    request.setPayload(payload);
    request.getOptions().setContentFormat(MediaTypeRegistry.TEXT_PLAIN);
   
    if (request.getScheme().equals(CoAP.COAP_SECURE_URI_SCHEME)) {
      dtlsEndpoint = new CoAPEndpoint(new DTLSConnector(new InetSocketAddress(0)), NetworkConfig.getStandard());
      dtlsEndpoint.setMessageDeliverer(new ClientMessageDeliverer());
      dtlsEndpoint.start();
      EndpointManager.getEndpointManager().setDefaultSecureEndpoint(dtlsEndpoint);
    }
   
View Full Code Here


   * Binds the server to a ephemeral port on the specified address.
   *
   * @param address the address
   */
  private void bind(InetSocketAddress address) {
    Endpoint endpoint = new CoAPEndpoint(address, this.config);
    addEndpoint(endpoint);
  }
View Full Code Here

  }
 
  @Override
  public final Endpoint getEndpoint(NetworkConfig config, InetSocketAddress address) {
   
    CoAPEndpoint endpoint = new CoAPEndpoint(address, config);
    return endpoint;
  }
View Full Code Here

  @Override
  public final Endpoint getSecureEndpoint(NetworkConfig config, InetSocketAddress address) {

    Endpoint endpoint = null;
    if (secureConnectorFactory != null) {
      endpoint = new CoAPEndpoint(
          secureConnectorFactory.newConnector(address),
          config);
    } else {
      log.fine("A secure ConnectorFactory is required to create secure Endpoints.");
    }
View Full Code Here

     
    server.add(new BenchmarkResource("benchmark"));
    server.add(new FibonacciResource("fibonacci"));
    server.add(new ShutDownResource("shutdown"));
   
    server.addEndpoint(new CoAPEndpoint(sockAddr));
    server.start();

    System.out.println("Benchmark server listening on " + sockAddr);
  }
View Full Code Here

        // ETSI Plugtest environment
//    server.addEndpoint(new CoAPEndpoint(new DTLSConnector(new InetSocketAddress("::1", DTLS_PORT)), NetworkConfig.getStandard()));
//    server.addEndpoint(new CoAPEndpoint(new DTLSConnector(new InetSocketAddress("127.0.0.1", DTLS_PORT)), NetworkConfig.getStandard()));
//    server.addEndpoint(new CoAPEndpoint(new DTLSConnector(new InetSocketAddress("2a01:c911:0:2010::10", DTLS_PORT)), NetworkConfig.getStandard()));
//    server.addEndpoint(new CoAPEndpoint(new DTLSConnector(new InetSocketAddress("10.200.1.2", DTLS_PORT)), NetworkConfig.getStandard()));
    server.addEndpoint(new CoAPEndpoint(new DTLSConnector(new InetSocketAddress(DTLS_PORT)), NetworkConfig.getStandard()));
    server.start();

        // add special interceptor for message traces
        for (Endpoint ep:server.getEndpoints()) {
          ep.addInterceptor(new MessageTracer());
View Full Code Here

TOP

Related Classes of ch.ethz.inf.vs.californium.network.CoAPEndpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.