/** * Creates a new STUN server. * * @param codecFactory The factory for creating STUN codecs. * @param ioHandler The IO handler, often a demuxing handler that * demultiplexes STUN with the media protocol. * @param threadName The name of the thread to use. */ public AbstractStunServer(final ProtocolCodecFactory codecFactory, final IoHandler ioHandler, final String threadName) { ByteBuffer.setUseDirectBuffers(false); ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); this.codecFactory = codecFactory; this.ioHandler = ioHandler; this.threadName = threadName; }
/** * Creates a new TCP TURN client. * * @param clientListener The listener for TURN client events. * @param candidateProvider The class that provides TURN candidate * servers. * @param codecFactory The codec factory. */ public TcpTurnClient(final TurnClientListener clientListener, final CandidateProvider<InetSocketAddress> candidateProvider, final ProtocolCodecFactory codecFactory) { m_turnClientListener = clientListener; m_candidateProvider = candidateProvider; m_dataCodecFactory = codecFactory; // Configure the MINA buffers for optimal performance. ByteBuffer.setUseDirectBuffers(false); ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); }
/** * Launches the STUN server. * * @param args The command line arguments. */ public static void main(final String[] args) { LOG.debug("Launching SIP and TURN servers..."); ByteBuffer.setUseDirectBuffers(false); ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); final StunServerLauncher launcher = new StunServerLauncher(); LOG.debug("Created launcher"); try { launcher.launch(); LOG.debug("Started launcher"); } catch (final IOException e) { LOG.error("Could not start!!!",e); } }
ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); m_originalLocalAddress = localAddress; if (transactionTracker == null) {
ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); m_handler = handler; final Executor executor = Executors.newCachedThreadPool(