Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jetty-websocket')
-rw-r--r--jetty-websocket/javax-websocket-client-impl/pom.xml2
-rw-r--r--jetty-websocket/javax-websocket-server-impl/pom.xml2
-rw-r--r--jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod5
-rw-r--r--jetty-websocket/pom.xml2
-rw-r--r--jetty-websocket/websocket-api/pom.xml2
-rw-r--r--jetty-websocket/websocket-client/pom.xml2
-rw-r--r--jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java29
-rw-r--r--jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientCloseTest.java14
-rw-r--r--jetty-websocket/websocket-common/pom.xml2
-rw-r--r--jetty-websocket/websocket-server/pom.xml2
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java2
-rw-r--r--jetty-websocket/websocket-servlet/pom.xml2
12 files changed, 40 insertions, 26 deletions
diff --git a/jetty-websocket/javax-websocket-client-impl/pom.xml b/jetty-websocket/javax-websocket-client-impl/pom.xml
index ee1e1ced71..cd091afd11 100644
--- a/jetty-websocket/javax-websocket-client-impl/pom.xml
+++ b/jetty-websocket/javax-websocket-client-impl/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-parent</artifactId>
- <version>9.3.7-SNAPSHOT</version>
+ <version>9.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jetty-websocket/javax-websocket-server-impl/pom.xml b/jetty-websocket/javax-websocket-server-impl/pom.xml
index 65f52c5f07..d231be243b 100644
--- a/jetty-websocket/javax-websocket-server-impl/pom.xml
+++ b/jetty-websocket/javax-websocket-server-impl/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-parent</artifactId>
- <version>9.3.7-SNAPSHOT</version>
+ <version>9.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod b/jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod
index e866b17989..cdc474a6c9 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod
@@ -1,6 +1,5 @@
-#
-# WebSocket Module
-#
+[description]
+Enable websockets for deployed web applications
[depend]
# javax.websocket needs annotations
diff --git a/jetty-websocket/pom.xml b/jetty-websocket/pom.xml
index cc57deb73f..27e0782df4 100644
--- a/jetty-websocket/pom.xml
+++ b/jetty-websocket/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>jetty-project</artifactId>
<groupId>org.eclipse.jetty</groupId>
- <version>9.3.7-SNAPSHOT</version>
+ <version>9.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jetty-websocket/websocket-api/pom.xml b/jetty-websocket/websocket-api/pom.xml
index 79cadd126d..559620f5fc 100644
--- a/jetty-websocket/websocket-api/pom.xml
+++ b/jetty-websocket/websocket-api/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-parent</artifactId>
- <version>9.3.7-SNAPSHOT</version>
+ <version>9.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jetty-websocket/websocket-client/pom.xml b/jetty-websocket/websocket-client/pom.xml
index 98af4976cd..7b48388dde 100644
--- a/jetty-websocket/websocket-client/pom.xml
+++ b/jetty-websocket/websocket-client/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-parent</artifactId>
- <version>9.3.7-SNAPSHOT</version>
+ <version>9.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
index 35180c4aca..a71a4a36c9 100644
--- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
+++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
@@ -19,6 +19,7 @@
package org.eclipse.jetty.websocket.client.io;
import java.io.IOException;
+import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.util.concurrent.Executor;
@@ -31,6 +32,7 @@ import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ManagedSelector;
import org.eclipse.jetty.io.SelectChannelEndPoint;
import org.eclipse.jetty.io.SelectorManager;
+import org.eclipse.jetty.io.SocketChannelEndPoint;
import org.eclipse.jetty.io.ssl.SslConnection;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -53,7 +55,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
}
@Override
- protected void connectionFailed(SocketChannel channel, Throwable ex, Object attachment)
+ protected void connectionFailed(SelectableChannel channel, Throwable ex, Object attachment)
{
if (LOG.isDebugEnabled())
LOG.debug("Connection Failed",ex);
@@ -67,7 +69,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
}
@Override
- public Connection newConnection(final SocketChannel channel, EndPoint endPoint, final Object attachment) throws IOException
+ public Connection newConnection(final SelectableChannel channel, EndPoint endPoint, final Object attachment) throws IOException
{
if (LOG.isDebugEnabled())
LOG.debug("newConnection({},{},{})",channel,endPoint,attachment);
@@ -114,24 +116,33 @@ public class WebSocketClientSelectorManager extends SelectorManager
}
}
+
@Override
- protected EndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey selectionKey) throws IOException
+ protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey) throws IOException
{
if (LOG.isDebugEnabled())
- LOG.debug("newEndPoint({}, {}, {})",channel,selectSet,selectionKey);
- return new SelectChannelEndPoint(channel,selectSet,selectionKey,getScheduler(),policy.getIdleTimeout());
+ LOG.debug("newEndPoint({}, {}, {})",channel,selector,selectionKey);
+ SocketChannelEndPoint endp = new SocketChannelEndPoint(channel, selector, selectionKey, getScheduler());
+ endp.setIdleTimeout(policy.getIdleTimeout());
+ return endp;
}
- public SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel)
+ public SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SelectableChannel channel)
{
- String peerHost = channel.socket().getInetAddress().getHostName();
- int peerPort = channel.socket().getPort();
+ String peerHost = null;
+ int peerPort = 0;
+ if (channel instanceof SocketChannel)
+ {
+ SocketChannel sc = (SocketChannel)channel;
+ peerHost = sc.socket().getInetAddress().getHostName();
+ peerPort = sc.socket().getPort();
+ }
SSLEngine engine = sslContextFactory.newSSLEngine(peerHost,peerPort);
engine.setUseClientMode(true);
return engine;
}
- public UpgradeConnection newUpgradeConnection(SocketChannel channel, EndPoint endPoint, ConnectPromise connectPromise)
+ public UpgradeConnection newUpgradeConnection(SelectableChannel channel, EndPoint endPoint, ConnectPromise connectPromise)
{
WebSocketClient client = connectPromise.getClient();
Executor executor = client.getExecutor();
diff --git a/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientCloseTest.java b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientCloseTest.java
index 2cbc3ab747..68079c385c 100644
--- a/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientCloseTest.java
+++ b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientCloseTest.java
@@ -23,6 +23,7 @@ import static org.hamcrest.Matchers.*;
import java.io.IOException;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
+import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.util.Arrays;
@@ -37,6 +38,7 @@ import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.io.ManagedSelector;
import org.eclipse.jetty.io.SelectChannelEndPoint;
+import org.eclipse.jetty.io.SocketChannelEndPoint;
import org.eclipse.jetty.toolchain.test.EventQueue;
import org.eclipse.jetty.toolchain.test.TestTracker;
import org.eclipse.jetty.util.BufferUtil;
@@ -283,19 +285,21 @@ public class ClientCloseTest
}
@Override
- protected EndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey selectionKey) throws IOException
+ protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selectSet, SelectionKey selectionKey) throws IOException
{
- return new TestEndPoint(channel,selectSet,selectionKey,getScheduler(),getPolicy().getIdleTimeout());
+ TestEndPoint endp = new TestEndPoint(channel,selectSet,selectionKey,getScheduler());
+ endp.setIdleTimeout(getPolicy().getIdleTimeout());
+ return endp;
}
}
- public static class TestEndPoint extends SelectChannelEndPoint
+ public static class TestEndPoint extends SocketChannelEndPoint
{
public AtomicBoolean congestedFlush = new AtomicBoolean(false);
- public TestEndPoint(SocketChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler, long idleTimeout)
+ public TestEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler)
{
- super(channel,selector,key,scheduler,idleTimeout);
+ super((SocketChannel)channel,selector,key,scheduler);
}
@Override
diff --git a/jetty-websocket/websocket-common/pom.xml b/jetty-websocket/websocket-common/pom.xml
index e8bcacac26..ff3b0c8ad5 100644
--- a/jetty-websocket/websocket-common/pom.xml
+++ b/jetty-websocket/websocket-common/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-parent</artifactId>
- <version>9.3.7-SNAPSHOT</version>
+ <version>9.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jetty-websocket/websocket-server/pom.xml b/jetty-websocket/websocket-server/pom.xml
index 3d6be16321..c91380ac88 100644
--- a/jetty-websocket/websocket-server/pom.xml
+++ b/jetty-websocket/websocket-server/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-parent</artifactId>
- <version>9.3.7-SNAPSHOT</version>
+ <version>9.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java
index 5810768f97..e6f280db28 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java
@@ -136,7 +136,7 @@ public class BrowserSocket
if (message.charAt(0) == '@')
{
String name = message.substring(1);
- URL url = Loader.getResource(BrowserSocket.class,name);
+ URL url = Loader.getResource(name);
if (url == null)
{
writeMessage("Unable to find resource: " + name);
diff --git a/jetty-websocket/websocket-servlet/pom.xml b/jetty-websocket/websocket-servlet/pom.xml
index 196270c627..19e6231c8d 100644
--- a/jetty-websocket/websocket-servlet/pom.xml
+++ b/jetty-websocket/websocket-servlet/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-parent</artifactId>
- <version>9.3.7-SNAPSHOT</version>
+ <version>9.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Back to the top