本文整理了Java中org.eclipse.jetty.client.HttpClient.getByteBufferPool()
方法的一些代码示例,展示了HttpClient.getByteBufferPool()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpClient.getByteBufferPool()
方法的具体详情如下:
包路径:org.eclipse.jetty.client.HttpClient
类名称:HttpClient
方法名:getByteBufferPool
暂无
代码示例来源:origin: resteasy/Resteasy
@Override
public void onContent(Response response, ByteBuffer buf) {
final ByteBufferPool bufs = client.getByteBufferPool();
final ByteBuffer copy = bufs.acquire(buf.remaining(), false);
copy.limit(buf.remaining());
copy.put(buf);
copy.flip();
stream.offer(copy, new ReleaseCallback(bufs, copy));
}
代码示例来源:origin: org.eclipse.jetty.websocket/websocket-client
@Override
public ByteBufferPool getBufferPool()
{
return httpClient.getByteBufferPool();
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
private void release()
{
httpClient.getByteBufferPool().release(chunkBuffer);
chunkBuffer = null;
}
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
protected SslConnection newSslConnection(HttpClient httpClient, EndPoint endPoint, SSLEngine engine)
{
return new SslConnection(httpClient.getByteBufferPool(), httpClient.getExecutor(), endPoint, engine);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
protected SslConnection newSslConnection(HttpClient httpClient, EndPoint endPoint, SSLEngine engine)
{
return new SslConnection(httpClient.getByteBufferPool(), httpClient.getExecutor(), endPoint, engine);
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
private void releaseBuffer()
{
if (buffer == null)
throw new IllegalStateException();
if (BufferUtil.hasContent(buffer))
throw new IllegalStateException();
HttpClient client = getHttpDestination().getHttpClient();
ByteBufferPool bufferPool = client.getByteBufferPool();
bufferPool.release(buffer);
buffer = null;
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
protected ClientConnectionFactory newSslClientConnectionFactory(ClientConnectionFactory connectionFactory)
{
return new SslClientConnectionFactory(getSslContextFactory(), getByteBufferPool(), getExecutor(), connectionFactory);
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
private void acquireBuffer()
{
HttpClient client = getHttpDestination().getHttpClient();
ByteBufferPool bufferPool = client.getByteBufferPool();
buffer = bufferPool.acquire(client.getResponseBufferSize(), true);
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
private void release()
{
ByteBufferPool bufferPool = httpClient.getByteBufferPool();
if (!BufferUtil.isTheEmptyBuffer(headerBuffer))
bufferPool.release(headerBuffer);
headerBuffer = null;
if (!BufferUtil.isTheEmptyBuffer(chunkBuffer))
bufferPool.release(chunkBuffer);
chunkBuffer = null;
contentBuffer = null;
}
}
代码示例来源:origin: org.eclipse.jetty.spdy/spdy-http-server
@Override
public void onContent(final Response response, ByteBuffer content)
{
if (LOG.isDebugEnabled())
LOG.debug("onContent called with response: {} and content: {}. Sending response content to client.",
response, content);
final ByteBuffer contentCopy = httpClient.getByteBufferPool().acquire(content.remaining(), true);
BufferUtil.flipPutFlip(content, contentCopy);
ByteBufferDataInfo dataInfo = new ByteBufferDataInfo(contentCopy, false);
clientStream.data(dataInfo, new Callback()
{
@Override
public void failed(Throwable x)
{
LOG.debug("failed: ", x);
releaseBuffer();
response.abort(x);
}
@Override
public void succeeded()
{
releaseBuffer();
}
private void releaseBuffer()
{
httpClient.getByteBufferPool().release(contentCopy);
}
});
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
headerBuffer = httpClient.getByteBufferPool().acquire(httpClient.getRequestBufferSize(), false);
break;
chunkBuffer = httpClient.getByteBufferPool().acquire(HttpGenerator.CHUNK_SIZE, false);
break;
代码示例来源:origin: org.eclipse.jetty/jetty-client
chunkBuffer = httpClient.getByteBufferPool().acquire(httpClient.getRequestBufferSize(), false);
break;
代码示例来源:origin: org.eclipse.jetty.http2/http2-http-client-transport
@Override
protected void doStart() throws Exception
{
if (!client.isStarted())
{
HttpClient httpClient = getHttpClient();
client.setExecutor(httpClient.getExecutor());
client.setScheduler(httpClient.getScheduler());
client.setByteBufferPool(httpClient.getByteBufferPool());
client.setConnectTimeout(httpClient.getConnectTimeout());
client.setIdleTimeout(httpClient.getIdleTimeout());
client.setInputBufferSize(httpClient.getResponseBufferSize());
}
addBean(client);
super.doStart();
this.connectionFactory = new HTTP2ClientConnectionFactory();
client.setClientConnectionFactory((endPoint, context) ->
{
HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
return destination.getClientConnectionFactory().newConnection(endPoint, context);
});
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
ByteBufferPool bufferPool = httpClient.getByteBufferPool();
ByteBuffer chunk = null;
while (true)
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
ByteBufferPool bufferPool = client.getByteBufferPool();
ByteBuffer header = null;
ByteBuffer chunk = null;
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
ByteBufferPool bufferPool = client.getByteBufferPool();
ByteBuffer header = null;
ByteBuffer chunk = null;
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
ByteBufferPool bufferPool = client.getByteBufferPool();
ByteBuffer buffer = bufferPool.acquire(client.getResponseBufferSize(), true);
try
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
ByteBufferPool bufferPool = client.getByteBufferPool();
ByteBuffer buffer = bufferPool.acquire(client.getResponseBufferSize(), true);
try
内容来源于网络,如有侵权,请联系作者删除!