/** * Receive next message from network and forward them to the receiver. * * @throws Exception any exception that occurs */ private void receiveNextMessageFromNetwork() throws Exception { RawData raw = receiveNext(); if (raw != null) receiver.receiveData(raw); }
/** * Instantiates a new worker. * * @param name the name, e.g., of the transport protocol */ private Worker(String name) { super(name); setDaemon(true); }
/** * Determines if the correlation context of this object is secure. * * @return <code>true</code> if context is secure, <code>false</code> otherwise */ public boolean isSecure() { return (correlationContext != null && correlationContext.get(DtlsCorrelationContext.KEY_SESSION_ID) != null); } }
public void send(RawData raw) { if (raw.getAddress() == null || raw.getPort() == 0) { throw new RuntimeException("Message has no destination address/port"); } connector.send(raw); }
@Override public Object getStripe() { return msg.getInetSocketAddress(); }
private CorrelationContext getNonSecureCorrelationContext() { MapBasedCorrelationContext ctx = new MapBasedCorrelationContext(); ctx.put("someKey", "someValue"); return ctx; } }
@Override public void send(RawData msg) { if (msg.getMessageCallback() != null) { msg.getMessageCallback().onContextEstablished(context); latch.countDown(); } sentLatch.countDown(); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { rawDataChannel.receiveData((RawData) msg); } }
public String getCipher() { return get(KEY_CIPHER); } }
/** * Instantiates a new worker. * * @param name the name */ protected NetworkStageThread(String name) { super(ELEMENTS_THREAD_GROUP, name); setDaemon(true); }
@Override public InetSocketAddress getAddress() { return connector.getAddress(); }
@Override public void destroy() { stop(); }
public void destroy() { if (connector != null) { connector.destroy(); } }
/** * Receive next message from network and forward them to the receiver. * * @throws Exception any exception that occurs */ private void receiveNextMessageFromNetwork() throws Exception { RawData raw = receiveNext(); if (raw != null) receiver.receiveData(raw); }
public void receiveMessage(RawData message) { if (receiver != null) { receiver.receiveData(message); } }
public String getEpoch() { return get(KEY_EPOCH); }
/** * Instantiates a new worker. * * @param name the name, e.g., of the transport protocol */ private Worker(String name) { super(name); setDaemon(true); }
/** * Instantiates a new worker. * * @param name the name */ private NetworkStageThread(String name) { super(name); setDaemon(true); }
@Override public InetSocketAddress getAddress() { return connector.getAddress(); }
public String getSessionId() { return get(KEY_SESSION_ID); }