本文整理了Java中org.littleshoot.mina.common.ByteBuffer.setAllocator()
方法的一些代码示例,展示了ByteBuffer.setAllocator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.setAllocator()
方法的具体详情如下:
包路径:org.littleshoot.mina.common.ByteBuffer
类名称: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(
内容来源于网络,如有侵权,请联系作者删除!