org.littleshoot.mina.common.ByteBuffer.setAllocator()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(125)

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

ByteBuffer.setAllocator介绍

[英]Changes the current allocator with the specified one to manage the allocated buffers from now.
[中]将当前分配器更改为指定的分配器,以便从现在起管理分配的缓冲区。

代码示例

代码示例来源:origin: org.littleshoot/stun-server

/**
 * 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;
}

代码示例来源:origin: org.littleshoot/turn-client

/**
 * 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());
}

代码示例来源:origin: org.littleshoot/stun-server

/**
 * 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);
    }
  }

代码示例来源:origin: org.littleshoot/sip-client

ByteBuffer.setAllocator(new SimpleByteBufferAllocator());

代码示例来源:origin: org.littleshoot/stun-client

ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
m_originalLocalAddress = localAddress;
if (transactionTracker == null) {

代码示例来源:origin: org.littleshoot/mina-util

ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
m_handler = handler;
final Executor executor = Executors.newCachedThreadPool(

相关文章