Skip to content

unified stream manager #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 169 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
abba3db
empty to test
TingDaoK Oct 20, 2021
d00deed
phase 1
TingDaoK Oct 21, 2021
6c3d841
add comment
TingDaoK Oct 22, 2021
e617940
Merge branch 'main' into h2-support
TingDaoK Oct 22, 2021
0b37a88
test
TingDaoK Oct 25, 2021
82e9810
comments
TingDaoK Oct 25, 2021
addd531
WIP ping
TingDaoK Oct 25, 2021
289cb45
use future
TingDaoK Oct 25, 2021
123249b
fix the issue about object vs jlong
TingDaoK Oct 25, 2021
cb35552
mark the method unimplemented
TingDaoK Oct 25, 2021
16a5111
formatting
TingDaoK Oct 25, 2021
ece43cb
a little better check
TingDaoK Oct 26, 2021
7c10040
optimize code
TingDaoK Oct 26, 2021
0722323
goaway support
TingDaoK Oct 26, 2021
ac051f8
connection window update
TingDaoK Oct 26, 2021
22d49fb
WIP for settings
TingDaoK Oct 26, 2021
9d2adbd
update the name
TingDaoK Oct 26, 2021
e8369d1
settings
TingDaoK Oct 26, 2021
e91328b
comments addressed
TingDaoK Oct 27, 2021
6da168d
I don't like this format
TingDaoK Oct 27, 2021
30caba9
Merge branch 'h2-support' into h2-support-2
TingDaoK Oct 27, 2021
b1f64bd
add getter
TingDaoK Oct 27, 2021
d430a2a
exclude the marshall function from javadoc
TingDaoK Oct 27, 2021
0505971
clean up the jobject local ref
TingDaoK Oct 27, 2021
a46a555
Merge branch 'h2-support' into h2-support-2
TingDaoK Oct 27, 2021
ae4bbc7
update the doc about null is acceptable
TingDaoK Oct 27, 2021
b5d7470
Merge branch 'h2-support' into h2-support-2
TingDaoK Oct 27, 2021
3661a3b
Merge branch 'h2-support' into h2-support-2
TingDaoK Oct 28, 2021
4191525
todo: testing
TingDaoK Oct 28, 2021
f774190
tests added
TingDaoK Oct 28, 2021
6e2534c
check the value range
TingDaoK Oct 28, 2021
4798e80
allocate array to the heap
TingDaoK Oct 28, 2021
0b7efcc
you need allocator
TingDaoK Oct 28, 2021
33eb144
zero check
TingDaoK Oct 29, 2021
f157d8c
http2 stream support
TingDaoK Oct 29, 2021
c989e4a
Merge branch 'main' into h2-support
TingDaoK Oct 29, 2021
6e32484
Merge branch 'h2-support' into h2-support-2
TingDaoK Oct 29, 2021
74c48f3
add comment
TingDaoK Oct 29, 2021
8fd7696
thanks mike for fixing the exception
TingDaoK Oct 29, 2021
7f8b905
http2 request
TingDaoK Nov 2, 2021
4d88b71
http2 request
TingDaoK Nov 2, 2021
ecf504e
update the test
TingDaoK Nov 2, 2021
40f9377
auto format
TingDaoK Nov 2, 2021
895edc6
formatting
TingDaoK Nov 2, 2021
3727158
elasticurl wip
graebm May 18, 2020
dcbb787
use async callback instead
TingDaoK Nov 3, 2021
73d937e
address comments from Mike
TingDaoK Nov 3, 2021
d1a9e13
Remove s from the name of structure
TingDaoK Nov 3, 2021
2f643d7
Merge branch 'h2-support-2' into h2-message-header
TingDaoK Nov 3, 2021
d2b70c6
use the tag
TingDaoK Nov 3, 2021
feec4a9
address comments
TingDaoK Nov 3, 2021
5d9d9ed
the empty path and method should be read out
TingDaoK Nov 3, 2021
0f8506a
add comments around to make it more clear
TingDaoK Nov 4, 2021
dc0c3c2
Merge branch 'h2-message-header' into h2-elasticurl
TingDaoK Nov 4, 2021
1d515c6
Merge branch 'main' into h2-support
TingDaoK Nov 4, 2021
57f1a64
It's working! TIME TO FIND Out how to run java now
TingDaoK Nov 4, 2021
c795b78
I don't know...
TingDaoK Nov 4, 2021
13945b1
let's see
TingDaoK Nov 4, 2021
6548135
next test
TingDaoK Nov 4, 2021
7c65045
use a runner to run elasticurl
TingDaoK Nov 5, 2021
958f8a9
update the script
TingDaoK Nov 5, 2021
e2503c9
The builder folder is magic
TingDaoK Nov 5, 2021
2a6f61f
hmmm
TingDaoK Nov 5, 2021
c817504
normal test first
TingDaoK Nov 5, 2021
aacde74
runner to take care the "\"" stuff
TingDaoK Nov 5, 2021
ec83d5c
protocol version -> Http version
TingDaoK Nov 5, 2021
14528c6
more compile error
TingDaoK Nov 5, 2021
97ef42c
had fun
TingDaoK Nov 5, 2021
50a501a
why it's failling harder
TingDaoK Nov 8, 2021
c2fb4af
add some debug info
TingDaoK Nov 8, 2021
aca4378
why
TingDaoK Nov 8, 2021
ffe074c
use the string as shell command
TingDaoK Nov 8, 2021
f842a7f
if windows
TingDaoK Nov 8, 2021
4d6ab13
remove shell
TingDaoK Nov 8, 2021
f369483
last shot about subprocess
TingDaoK Nov 8, 2021
6262328
use sh for testing
TingDaoK Nov 12, 2021
c580eac
bring the accidental comment out back
TingDaoK Nov 12, 2021
26f79eb
maybe this?
TingDaoK Nov 12, 2021
8bc6ffe
normal test
TingDaoK Nov 12, 2021
8c5068b
try not use shell?
TingDaoK Nov 12, 2021
9f496a4
Revert "try not use shell?"
TingDaoK Nov 13, 2021
406059f
clean things up
TingDaoK Nov 15, 2021
6ed625a
add warn level log
TingDaoK Nov 15, 2021
ad1bf7f
do we really need compress?
TingDaoK Nov 15, 2021
3be8129
missing unknown
TingDaoK Nov 15, 2021
adb9ef6
Merge branch 'main' into h2-support
TingDaoK Nov 30, 2021
c4a4c91
settings
TingDaoK Nov 30, 2021
f706974
Merge branch 'h2-support' of github.com:awslabs/aws-crt-java into h2-…
TingDaoK Dec 1, 2021
b1ef988
Merge branch 'main' into h2-support
TingDaoK Dec 1, 2021
4596ec4
Merge branch 'h2-support' into h2-elasticurl
TingDaoK Dec 2, 2021
191162c
settings
TingDaoK Dec 2, 2021
f677a14
update name
TingDaoK Dec 2, 2021
f19f1c5
merge conflict
TingDaoK Dec 2, 2021
24be4c8
revert the formatting change
TingDaoK Dec 2, 2021
7e250f8
Not sure it's a merge error or something
TingDaoK Dec 2, 2021
f4bc91c
override http 1.1 function to be un implemented for h2
TingDaoK Dec 6, 2021
7f5fd3f
sm wip
TingDaoK Jan 6, 2022
50e7f72
bascially it
TingDaoK Jan 13, 2022
d0a6c92
Merge branch 'main' into stream-manager
TingDaoK Jan 31, 2022
e776a52
use stream manager branch
TingDaoK Jan 31, 2022
979a253
java part finalizing
TingDaoK Jan 31, 2022
3957adb
Merge branch 'main' into http2-all
TingDaoK Jan 31, 2022
9df51fd
use the tag
TingDaoK Jan 31, 2022
9c2dab6
Merge branch 'http2-all' into stream-manager
TingDaoK Jan 31, 2022
b406ab4
get the stream public
TingDaoK Jan 31, 2022
2daf6fe
binding WIP
TingDaoK Feb 1, 2022
8936925
binding WIP
TingDaoK Feb 3, 2022
8849aa3
add tests and finalize binding
TingDaoK Feb 4, 2022
b33ba8d
git rid of the logs
TingDaoK Feb 4, 2022
279f5ab
use the version we got instead
TingDaoK Feb 4, 2022
fa2792c
Merge branch 'main' into http2-all
TingDaoK Feb 9, 2022
15a6e35
update submodules
TingDaoK Feb 9, 2022
2fa36cc
use the version we got instead
TingDaoK Feb 4, 2022
a82e280
Merge branch 'http2-all' into stream-manager
TingDaoK Feb 9, 2022
6b606c8
comment addressed
TingDaoK Feb 18, 2022
c65ff37
unified stream manager
TingDaoK Feb 21, 2022
82fd0dd
update test and add shutdown complete future
TingDaoK Feb 21, 2022
0a73ffc
remove the check as the resource is created outside the function
TingDaoK Feb 21, 2022
6de6dc4
remove log
TingDaoK Feb 21, 2022
43fda92
try to add assertion
TingDaoK Feb 21, 2022
0165c16
throw the original exception
TingDaoK Feb 21, 2022
2b69707
Add timeout and comments
TingDaoK Feb 21, 2022
84e30a8
fix a previous bug
TingDaoK Feb 22, 2022
f1e9479
make sure the exception throw out at the right place
TingDaoK Feb 23, 2022
3804371
update the comments
TingDaoK Feb 23, 2022
e3f31ff
Merge branch 'main' into http2-all
TingDaoK Feb 23, 2022
8c7adcb
Merge branch 'http2-all' into stream-manager
TingDaoK Feb 23, 2022
20687ac
Merge branch 'stream-manager' into unified-stream-manager
TingDaoK Feb 23, 2022
7be0f71
Merge branch 'main' into stream-manager
TingDaoK May 18, 2022
01f3475
fix a bunch of merge conflict
TingDaoK May 18, 2022
57794d9
input stream refcount stuff
TingDaoK May 18, 2022
8380667
trivial update
TingDaoK May 18, 2022
d760f08
try localhost ci
TingDaoK May 19, 2022
7878f61
checkout with submodules
TingDaoK May 19, 2022
26ed971
what's the file?
TingDaoK May 19, 2022
35a2314
the submodule is not updated
TingDaoK May 19, 2022
516acca
update more
TingDaoK May 19, 2022
afedcd9
fix osx
TingDaoK May 19, 2022
bdce86c
try just use mvn?
TingDaoK May 19, 2022
66d07cd
try to use action
TingDaoK May 19, 2022
8f6a2ac
add localhost test
TingDaoK May 20, 2022
78aebd8
forgot to commit action
TingDaoK May 20, 2022
a07b6bc
remove log
TingDaoK May 20, 2022
1b6d426
add test wtih body
TingDaoK May 21, 2022
372410d
test only 5?
TingDaoK May 22, 2022
945ca20
test 500
TingDaoK May 22, 2022
eb7bd25
added upload and download stress test
TingDaoK May 23, 2022
d84b032
add error level log
TingDaoK May 23, 2022
0194696
run again
TingDaoK May 23, 2022
fca7b3e
checkout the body received?
TingDaoK May 23, 2022
4a25bed
back to 2.5G
TingDaoK May 23, 2022
d01c96a
why????
TingDaoK May 23, 2022
dfce85f
more printout
TingDaoK May 23, 2022
b9aa5bc
more?
TingDaoK May 23, 2022
8217515
use join instead
TingDaoK May 24, 2022
d86b303
get the rest of CI back
TingDaoK May 24, 2022
6517d51
get rid of sutff not needed
TingDaoK May 24, 2022
11fe5c0
Merge branch 'localhost' into unified-stream-manager
TingDaoK Jun 2, 2022
e7ad920
add todo and remove things don't support anymore
TingDaoK Jun 2, 2022
6e565e9
fix broken api
TingDaoK Jun 2, 2022
037214e
Merge branch 'main' into stream-manager
TingDaoK Jun 4, 2022
77eac51
update submodules
TingDaoK Jun 4, 2022
6b32929
Merge branch 'main' into stream-manager
TingDaoK Jun 17, 2022
2c7cdab
adapt new api
TingDaoK Jun 17, 2022
a1f6f90
comments addressed
TingDaoK Jun 20, 2022
28d7417
Localhost test (#490)
TingDaoK Jun 21, 2022
d716423
Merge branch 'main' into stream-manager
TingDaoK Jun 21, 2022
7c37c64
Merge branch 'stream-manager' into unified-stream-manager
TingDaoK Jun 21, 2022
d2902cc
adapt new api
TingDaoK Jun 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .builder/actions/localhost_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Builder
import sys
import os


class LocalhostTest(Builder.Action):

def run(self, env):
env.shell.setenv('AWS_CRT_MEMORY_TRACING', '2')
actions = []
if os.system("mvn -Dtest=Http2ClientLocalHostTest test -DredirectTestOutputToFile=true -DforkCount=0 \
-DrerunFailingTestsCount=5 \
-Daws.crt.memory.tracing=2 \
-Daws.crt.debugnative=true \
-Daws.crt.localhost=true"):
# Failed
actions.append("exit 1")

return Builder.Script(actions, name='aws-crt-java-test')
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,60 @@ jobs:
# note: using "@main" because "@${{env.BUILDER_VERSION}}" doesn't work
# https://github.com/actions/runner/issues/480
uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main


localhost-test-linux:
runs-on: ubuntu-20.04 # latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Configure local host
run: |
python3 -m pip install h2
ls crt/aws-c-http/
cd crt/aws-c-http/tests/py_localhost/
python3 server.py &
python3 non_tls_server.py &
- name: Build and test
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz localhost-test -p ${{ env.PACKAGE_NAME }} --spec=downstream

localhost-test-mac:
runs-on: macos-11 # latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Configure local host
run: |
python3 -m pip install h2
cd crt/aws-c-http/tests/py_localhost/
python3 server.py &
python3 non_tls_server.py &
- name: Build and test
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder localhost-test -p ${{ env.PACKAGE_NAME }} --spec=downstream

localhost-test-win:
runs-on: windows-2022 # latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Configure local host
run: |
python -m pip install h2
- name: Build and test
run: |
cd crt/aws-c-http/tests/py_localhost/
Start-Process -NoNewWindow python .\server.py
Start-Process -NoNewWindow python .\non_tls_server.py
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz localhost-test -p ${{ env.PACKAGE_NAME }} downstream
245 changes: 245 additions & 0 deletions src/main/java/software/amazon/awssdk/crt/http/Http2StreamManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
package software.amazon.awssdk.crt.http;

import software.amazon.awssdk.crt.CrtResource;
import software.amazon.awssdk.crt.CrtRuntimeException;
import software.amazon.awssdk.crt.io.ClientBootstrap;
import software.amazon.awssdk.crt.io.SocketOptions;
import software.amazon.awssdk.crt.AsyncCallback;
import software.amazon.awssdk.crt.io.TlsContext;

import java.util.concurrent.CompletableFuture;
import java.net.URI;
import java.nio.charset.Charset;

/**
* Manages a Pool of HTTP/2 Streams. Creates and manages HTTP/2 connections
* under the hood.
*/
public class Http2StreamManager extends CrtResource {

private static final String HTTP = "http";
private static final String HTTPS = "https";
private static final int DEFAULT_HTTP_PORT = 80;
private static final int DEFAULT_HTTPS_PORT = 443;
private final static Charset UTF8 = java.nio.charset.StandardCharsets.UTF_8;

private final URI uri;
private final int port;
private final int maxConnections;
private final int idealConcurrentStreamsPerConnection;
private final int maxConcurrentStreamsPerConnection;
private final CompletableFuture<Void> shutdownComplete = new CompletableFuture<>();

/**
* Factory function for Http2StreamManager instances
*
* @param options configuration options
* @return a new instance of an Http2StreamManager
*/
public static Http2StreamManager create(Http2StreamManagerOptions options) {
return new Http2StreamManager(options);
}

private Http2StreamManager(Http2StreamManagerOptions options) {
options.validateOptions();

HttpClientConnectionManagerOptions connectionManagerOptions = options.getConnectionManagerOptions();
URI uri = connectionManagerOptions.getUri();
ClientBootstrap clientBootstrap = connectionManagerOptions.getClientBootstrap();
SocketOptions socketOptions = connectionManagerOptions.getSocketOptions();
boolean useTls = HTTPS.equals(uri.getScheme());
TlsContext tlsContext = connectionManagerOptions.getTlsContext();
int maxConnections = connectionManagerOptions.getMaxConnections();
int port = connectionManagerOptions.getPort();
if (port == -1) {
port = uri.getPort();
/* Pick a default port based on the scheme if one wasn't set */
if (port == -1) {
if (HTTP.equals(uri.getScheme())) { port = DEFAULT_HTTP_PORT; }
if (HTTPS.equals(uri.getScheme())) { port = DEFAULT_HTTPS_PORT; }
}
}

int maxConcurrentStreamsPerConnection = options.getMaxConcurrentStreamsPerConnection();
int idealConcurrentStreamsPerConnection = options.getIdealConcurrentStreamsPerConnection();

this.uri = uri;
this.port = port;
this.maxConnections = maxConnections;
this.idealConcurrentStreamsPerConnection = idealConcurrentStreamsPerConnection;
this.maxConcurrentStreamsPerConnection = maxConcurrentStreamsPerConnection;

int proxyConnectionType = 0;
String proxyHost = null;
int proxyPort = 0;
TlsContext proxyTlsContext = null;
int proxyAuthorizationType = 0;
String proxyAuthorizationUsername = null;
String proxyAuthorizationPassword = null;
HttpProxyOptions proxyOptions = connectionManagerOptions.getProxyOptions();

if (proxyOptions != null) {
proxyConnectionType = proxyOptions.getConnectionType().getValue();
proxyHost = proxyOptions.getHost();
proxyPort = proxyOptions.getPort();
proxyTlsContext = proxyOptions.getTlsContext();
proxyAuthorizationType = proxyOptions.getAuthorizationType().getValue();
proxyAuthorizationUsername = proxyOptions.getAuthorizationUsername();
proxyAuthorizationPassword = proxyOptions.getAuthorizationPassword();
}

HttpMonitoringOptions monitoringOptions = connectionManagerOptions.getMonitoringOptions();
long monitoringThroughputThresholdInBytesPerSecond = 0;
int monitoringFailureIntervalInSeconds = 0;
if (monitoringOptions != null) {
monitoringThroughputThresholdInBytesPerSecond = monitoringOptions.getMinThroughputBytesPerSecond();
monitoringFailureIntervalInSeconds = monitoringOptions.getAllowableThroughputFailureIntervalSeconds();
}

acquireNativeHandle(http2StreamManagerNew(this,
clientBootstrap.getNativeHandle(),
socketOptions.getNativeHandle(),
useTls ? tlsContext.getNativeHandle() : 0,
Http2ConnectionSetting.marshallSettingsForJNI(options.getInitialSettingsList()),
uri.getHost().getBytes(UTF8),
port,
proxyConnectionType,
proxyHost != null ? proxyHost.getBytes(UTF8) : null,
proxyPort,
proxyTlsContext != null ? proxyTlsContext.getNativeHandle() : 0,
proxyAuthorizationType,
proxyAuthorizationUsername != null ? proxyAuthorizationUsername.getBytes(UTF8) : null,
proxyAuthorizationPassword != null ? proxyAuthorizationPassword.getBytes(UTF8) : null,
connectionManagerOptions.isManualWindowManagement(),
monitoringThroughputThresholdInBytesPerSecond,
monitoringFailureIntervalInSeconds,
maxConnections,
idealConcurrentStreamsPerConnection,
maxConcurrentStreamsPerConnection));

/*
* we don't need to add a reference to socketOptions since it's copied during
* connection manager construction
*/
addReferenceTo(clientBootstrap);
if (useTls) {
addReferenceTo(tlsContext);
}
}

/**
* Request a Http2Stream from StreamManager.
*
* @param request The Request to make to the Server.
* @param streamHandler The Stream Handler to be called from the Native
* EventLoop
* @return A future for a Http2Stream that will be completed when the stream is
* acquired.
*/
public CompletableFuture<Http2Stream> acquireStream(Http2Request request,
HttpStreamBaseResponseHandler streamHandler) {

return this.acquireStream((HttpRequestBase) request, streamHandler);
}

public CompletableFuture<Http2Stream> acquireStream(HttpRequest request,
HttpStreamBaseResponseHandler streamHandler) {

return this.acquireStream((HttpRequestBase) request, streamHandler);
}

public CompletableFuture<Http2Stream> acquireStream(HttpRequestBase request,
HttpStreamBaseResponseHandler streamHandler) {
CompletableFuture<Http2Stream> completionFuture = new CompletableFuture<>();
AsyncCallback acquireStreamCompleted = AsyncCallback.wrapFuture(completionFuture, null);
if (isNull()) {
completionFuture.completeExceptionally(new IllegalStateException(
"Http2StreamManager has been closed, can't acquire new streams"));
return completionFuture;
}
try {
http2StreamManagerAcquireStream(this.getNativeHandle(),
request.marshalForJni(),
request.getBodyStream(),
new HttpStreamResponseHandlerNativeAdapter(streamHandler),
acquireStreamCompleted);
} catch (CrtRuntimeException ex) {
completionFuture.completeExceptionally(ex);
}
return completionFuture;
}

/**
* Called from Native when all Streams from this Stream manager have finished
* and underlying resources like connections opened under the hood has been
* cleaned up
* begin releasing Native Resources that Http2StreamManager depends on.
*/
private void onShutdownComplete() {
releaseReferences();

this.shutdownComplete.complete(null);
}

/**
* Determines whether a resource releases its dependencies at the same time the
* native handle is released or if it waits.
* Resources that wait are responsible for calling releaseReferences() manually.
*/
@Override
protected boolean canReleaseReferencesImmediately() {
return false;
}

/**
* Closes this Connection Pool and any pending Connection Acquisitions
*/
@Override
protected void releaseNativeHandle() {
if (!isNull()) {
/*
* Release our Native pointer and schedule tasks on the Native Event Loop to
* start sending HTTP/TLS/TCP
* connection shutdown messages to peers for any open Connections.
*/
http2StreamManagerRelease(getNativeHandle());
}
}

public CompletableFuture<Void> getShutdownCompleteFuture() {
return shutdownComplete;
}

/*******************************************************************************
* Native methods
******************************************************************************/

private static native long http2StreamManagerNew(Http2StreamManager thisObj,
long client_bootstrap,
long socketOptions,
long tlsContext,
long[] marshalledSettings,
byte[] endpoint,
int port,
int proxyConnectionType,
byte[] proxyHost,
int proxyPort,
long proxyTlsContext,
int proxyAuthorizationType,
byte[] proxyAuthorizationUsername,
byte[] proxyAuthorizationPassword,
boolean isManualWindowManagement,
long monitoringThroughputThresholdInBytesPerSecond,
int monitoringFailureIntervalInSeconds,
int maxConns,
int ideal_concurrent_streams_per_connection,
int max_concurrent_streams_per_connection) throws CrtRuntimeException;

private static native void http2StreamManagerRelease(long stream_manager) throws CrtRuntimeException;

private static native void http2StreamManagerAcquireStream(long stream_manager,
byte[] marshalledRequest,
HttpRequestBodyStream bodyStream,
HttpStreamResponseHandlerNativeAdapter responseHandler,
AsyncCallback completedCallback) throws CrtRuntimeException;
}
Loading