@Override public void messageReceived(final IoSession session, final Object message) { final StunMessage vsm = (StunMessage) message; vsm.accept(this.visitor); }
private T notifyTransaction(final StunMessage response) { final StunClientTransaction<T> ct = this.m_transactionTracker.getClientTransaction(response); m_log.debug("Accessed transaction: {}", ct); if (ct == null) { // This will happen fairly frequently with UDP because messages // are retransmitted in case any are lost. When responses are // received, the transaction ID is removed, so we won't recognize // the IDs of subsequent responses. m_log.debug("No matching transaction for response: {}", response); return null; } return response.accept(ct); }
public void encode(final IoSession session, final Object msg, final ProtocolEncoderOutput out) throws Exception { m_log.debug("Encoding TURN/STUN message: {}", msg); final StunMessage stunMessage = (StunMessage) msg; final TurnStunMessageMapper mapper = (TurnStunMessageMapper) session.getAttribute( "REMOTE_ADDRESS_MAP"); final StunMessageVisitor<ByteBuffer> visitor = new SendIndicationStunMessageVisitor(out, mapper); stunMessage.accept(visitor); }
@Override public void messageReceived(final IoSession session, final Object message) { m_log.debug("Received message: {}", message); if (session.isClosing() || !session.isConnected()) { m_log.debug("Ignoring message on closing session..."); return; } final StunMessage stunMessage = (StunMessage) message; // The visitor will handle the particular message type, allowing for // variation between, for example, client and server visitor // implementations. final StunMessageVisitor visitor = this.m_visitorFactory .createVisitor(session); m_log.debug("Sending message to visitor: {}", visitor); stunMessage.accept(visitor); }
try sm.accept(visitor);
final InetSocketAddress isa = message.accept(visitor); if (isa == null) { onFailure(m_stunServer);
final IceCandidate newLocalCandidate = response.accept(visitor); if (newLocalCandidate == null)