summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-05-26 05:54:11 (EDT)
committerEike Stepper2008-05-26 05:54:11 (EDT)
commitc6d6a06170d48db469844e09519d67e8634cabdf (patch)
tree493f642c56b7fca4398996d0fb9f9f017cc8ab6f
parente5b2299835fe237e5fa00d25d93dcd251528d5a1 (diff)
downloadcdo-c6d6a06170d48db469844e09519d67e8634cabdf.zip
cdo-c6d6a06170d48db469844e09519d67e8634cabdf.tar.gz
cdo-c6d6a06170d48db469844e09519d67e8634cabdf.tar.bz2
[232648] Provide an HTTPConnector
https://bugs.eclipse.org/bugs/show_bug.cgi?id=232648
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java26
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/QueuedBuffer.java29
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/HTTPTest.java4
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/Net4jEchoTestServlet.java3
4 files changed, 30 insertions, 32 deletions
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java
index edafc61..31c8837 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java
@@ -226,4 +226,30 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
{
return true;
}
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class QueuedBuffer
+ {
+ private IBuffer buffer;
+
+ private long channelCount;
+
+ public QueuedBuffer(IBuffer buffer, long channelCount)
+ {
+ this.buffer = buffer;
+ this.channelCount = channelCount;
+ }
+
+ public IBuffer getBuffer()
+ {
+ return buffer;
+ }
+
+ public long getChannelCount()
+ {
+ return channelCount;
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/QueuedBuffer.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/QueuedBuffer.java
deleted file mode 100644
index 9eeed6e..0000000
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/QueuedBuffer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.net4j.internal.http;
-
-import org.eclipse.net4j.buffer.IBuffer;
-
-/**
- * @author Eike Stepper
- */
-public final class QueuedBuffer
-{
- private IBuffer buffer;
-
- private long channelCount;
-
- public QueuedBuffer(IBuffer buffer, long channelCount)
- {
- this.buffer = buffer;
- this.channelCount = channelCount;
- }
-
- public IBuffer getBuffer()
- {
- return buffer;
- }
-
- public long getChannelCount()
- {
- return channelCount;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/HTTPTest.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/HTTPTest.java
index aee0282..68f4fe0 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/HTTPTest.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/HTTPTest.java
@@ -84,7 +84,7 @@ public class HTTPTest extends AbstractTransportTest
{
try
{
- System.out.println("Writing " + b);
+ msg("Writing " + b);
out.write(b);
out.flush();
Thread.sleep(1000);
@@ -106,7 +106,7 @@ public class HTTPTest extends AbstractTransportTest
assertEquals(i, b);
long gap = in.readLong();
- System.out.println("Gap: " + gap);
+ msg("Gap: " + gap);
}
method.releaseConnection();
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/Net4jEchoTestServlet.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/Net4jEchoTestServlet.java
index de8f5d9..ecd4106 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/Net4jEchoTestServlet.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/tests/Net4jEchoTestServlet.java
@@ -12,6 +12,7 @@ package org.eclipse.net4j.internal.http.tests;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+import org.eclipse.net4j.util.io.IOUtil;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
@@ -62,7 +63,7 @@ public class Net4jEchoTestServlet extends HttpServlet
long now = System.currentTimeMillis();
long gap = now - lastTime;
lastTime = now;
- System.out.println("Gap: " + gap);
+ IOUtil.OUT().println("Gap: " + gap);
out.writeByte(b);
out.writeLong(gap);