use of org.webpieces.httpclient.api.HttpClient in project webpieces by deanhiller.
the class IntegGoogleHttps method createSocket.
public static HttpSocket createSocket(boolean isHttp, String host, int port) {
HttpClient client = createHttpClient();
HttpSocket socket;
if (isHttp)
socket = client.createHttpSocket("oneTimer");
else {
ForTestSslClientEngineFactory sslFactory = new ForTestSslClientEngineFactory();
socket = client.createHttpsSocket("oneTimer", sslFactory.createSslEngine(host, port));
}
return socket;
}
use of org.webpieces.httpclient.api.HttpClient in project webpieces by deanhiller.
the class IntegGoogleHttps method createHttpClient.
public static HttpClient createHttpClient() {
BufferPool pool2 = new BufferCreationPool();
Executor executor2 = Executors.newFixedThreadPool(10, new NamedThreadFactory("clientThread"));
ChannelManagerFactory factory = ChannelManagerFactory.createFactory();
ChannelManager mgr = factory.createMultiThreadedChanMgr("client", pool2, executor2);
HttpParser parser = HttpParserFactory.createParser(pool2);
HttpClient client = HttpClientFactory.createHttpClient(mgr, parser);
return client;
}
Aggregations