Skip to content

Instantly share code, notes, and snippets.

private void awaitSpace() throws IOException {
while (in == out) {
checkStateForReceive();
/* full: kick any waiting readers */
notifyAll();
try {
wait(1000);
} catch (InterruptedException ex) {
throw new java.io.InterruptedIOException();
diff --git a/src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java b/src/main/java/com/ning/http/client/providers/netty/index bee7ae9..addcd55 100644
--- a/src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java
+++ b/src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java
@@ -42,10 +42,12 @@ import com.ning.http.util.AuthenticatorUtils;
import com.ning.http.util.SslUtils;
import com.ning.http.util.UTF8UrlEncoder;
import org.jboss.netty.bootstrap.ClientBootstrap;
+import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferOutputStream;
#
1.
10-19 08:57AM 48.678 /pubsub/aaaa 200 29459ms 11764cpu_ms 0kb Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10,gzip(gfe)
See details
66.131.224.29 - - [19/Oct/2010:08:58:18 -0700] "GET /pubsub/aaaa HTTP/1.1" 200 172 "http://atmosphere-pubsub.appspot.com/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10,gzip(gfe)" "atmosphere-pubsub.appspot.com" ms=29459 cpu_ms=11764 api_cpu_ms=0 cpm_usd=0.326850 exit_code=104
2.
I 10-19 08:57AM 50.631
-------------------------------------------------------------------------------
Test set: org.maven.ide.eclipse.io.UrlFetcherTest
-------------------------------------------------------------------------------
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.352 sec
testHttpOpenstreamFileNotFound(org.maven.ide.eclipse.io.UrlFetcherTest) Time elapsed: 0.786 sec
testHttpOpenstreamForbidden(org.maven.ide.eclipse.io.UrlFetcherTest) Time elapsed: 0.04 sec
testHttpOpenStream(org.maven.ide.eclipse.io.UrlFetcherTest) Time elapsed: 0.045 sec
testHttpUsernameAndPasswordSent(org.maven.ide.eclipse.io.UrlFetcherTest) Time elapsed: 0.103 sec
testHttpUsernameOnly(org.maven.ide.eclipse.io.UrlFetcherTest) Time elapsed: 0.031 sec
testHttpPasswordOnly(org.maven.ide.eclipse.io.UrlFetcherTest) Time elapsed: 0.023 sec
Non cached Request http://bad.host/catalogs/basic GET Pragma:no-cache Cache-Control:no-cache, no-store
2010-10-20 14:40:25,862 [Thread-0] ERROR o.m.ide.eclipse.io.HttpBaseSupport - [Thread-0] Exception Caught: null Attachment was null
2010-10-20 14:40:25,865 [Thread-0] ERROR o.m.ide.eclipse.io.HttpBaseSupport -
java.nio.channels.UnresolvedAddressException: null
at sun.nio.ch.Net.checkAddress(Net.java:30) [na:1.6.0_20]
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:487) [na:1.6.0_20]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140) [netty-3.2.2.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103) [netty-3.2.2.Final.jar:na]
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) [netty-3.2.2.Final.jar:na]
@jfarcand
jfarcand / gist:637257
Created October 20, 2010 20:34
Benchmark
BenchmarkResult{requestsPerSecond=2212.37, threads=10, batches=50, targetRequests=25000, successfulRequests=25000, failedRequests=0, averageRequestTime=4.52ms, averageBatchTime=2.26ms, totalBenchmarkTime=1.13ms}
BenchmarkResult{requestsPerSecond=902.11, threads=10, batches=50, targetRequests=25000, successfulRequests=25000, failedRequests=0, averageRequestTime=1.10ms, averageBatchTime=5.54ms, totalBenchmarkTime=2.77ms}
[ERROR] Failed to execute goal org.apache.maven.its.plugins:maven-it-plugin-artifact:2.1-SNAPSHOT:deploy (test) on project latin-1: Failed to deploy artifacts: Failed to deploy artifacts: Could not transfer artifact org.apache.maven.its.mng2362:latin-1:pom:0.1 from maven-core-it (file:////Users/jfarcand/workspace/core-integration-testing/core-it-suite/target/test-classes/mng-2362/latin-1/target/repo): Repository path /Users/jfarcand/workspace/core-integration-testing/core-it-suite/target/test-classes/mng-2362/latin-1/target/repo does not exist, and cannot be created. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.its.plugins:maven-it-plugin-artifact:2.1-SNAPSHOT:deploy (test) on project latin-1: Failed to deploy artifacts: Failed to deploy artifacts: Could not transfer artifact org.apache.maven.its.mng2362:latin-1:pom:0.1 from maven-core-it (file:////Users/jfarcand/workspace/core-integration-testing/core-it-suite/target/test-classes/mng-2362/latin-1
Description:
1.3.1 release
Details:
The following artifacts have been promoted to the Releases repository.
async-http-client-1.3.1-sources.jar
async-http-client-1.3.1-sources.jar.asc
45 [main] INFO org.eclipse.jetty.util.log - jetty-7.1.4.v20100610
136 [main] INFO org.eclipse.jetty.util.log - Started SelectChannelConnector@127.0.0.1:49744
Oct 26, 2010 9:52:32 AM com.ning.http.client.logging.JulLogger info
INFO: Local HTTP server started successfully
175 [main] INFO org.eclipse.jetty.util.log - jetty-7.1.4.v20100610
178 [main] INFO org.eclipse.jetty.util.log - Started SelectChannelConnector@127.0.0.1:49745
Oct 26, 2010 9:52:32 AM com.ning.http.client.logging.JulLogger debug
INFO: [main]
Non cached Request http://127.0.0.1:49745/uff GET
@Test(groups = {"standalone", "async"})
public void asyncConnectInvalidHostFuture() throws Throwable {
AsyncHttpClient c = new AsyncHttpClient();
try {
Response response = c.preparePost("http://aninvalidhost:9999/").execute(new AsyncCompletionHandlerAdapter() {
/* @Override */
public void onThrowable(Throwable t) {
t.printStackTrace();
}