Skip to content

Commit 1b9dda4

Browse files
author
Mathieu Carbou
committed
API break - changes signature of SocketIOServlet.doSocketIOConnect
1 parent 3f20333 commit 1b9dda4

File tree

8 files changed

+10
-11
lines changed

8 files changed

+10
-11
lines changed

core/src/main/java/com/glines/socketio/server/SocketIOServlet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ private void serve(HttpServletRequest request, HttpServletResponse response) thr
117117
transport.handle(request, response, new Transport.InboundFactory() {
118118

119119
@Override
120-
public SocketIOInbound getInbound(HttpServletRequest request, String[] protocols) {
121-
return SocketIOServlet.this.doSocketIOConnect(request, protocols);
120+
public SocketIOInbound getInbound(HttpServletRequest request) {
121+
return SocketIOServlet.this.doSocketIOConnect(request);
122122
}
123123

124124
}, sessionManager);
@@ -136,5 +136,5 @@ public void destroy() {
136136
* Returns an instance of SocketIOInbound or null if the connection is to be denied.
137137
* The value of cookies and protocols may be null.
138138
*/
139-
protected abstract SocketIOInbound doSocketIOConnect(HttpServletRequest request, String[] protocols);
139+
protected abstract SocketIOInbound doSocketIOConnect(HttpServletRequest request);
140140
}

core/src/main/java/com/glines/socketio/server/Transport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
public interface Transport {
3232
interface InboundFactory {
33-
SocketIOInbound getInbound(HttpServletRequest request, String[] protocols);
33+
SocketIOInbound getInbound(HttpServletRequest request);
3434
}
3535

3636
/**

core/src/main/java/com/glines/socketio/server/transport/WebSocketTransport.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ public void handle(HttpServletRequest request,
241241
origin = host;
242242
}
243243

244-
SocketIOInbound inbound = inboundFactory.getInbound(request,
245-
protocol == null ? null : protocol.split(" "));
244+
SocketIOInbound inbound = inboundFactory.getInbound(request);
246245
if (inbound == null) {
247246
if (hixie) {
248247
response.setHeader("Connection","close");

core/src/main/java/com/glines/socketio/server/transport/XHRTransport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ protected SocketIOSession connect(HttpServletRequest request,
375375
HttpServletResponse response, Transport.InboundFactory inboundFactory,
376376
com.glines.socketio.server.SocketIOSession.Factory sessionFactory)
377377
throws IOException {
378-
SocketIOInbound inbound = inboundFactory.getInbound(request, null);
378+
SocketIOInbound inbound = inboundFactory.getInbound(request);
379379
if (inbound != null) {
380380
SocketIOSession session = sessionFactory.createSession(inbound);
381381
XHRSessionHelper handler = createHelper(session);

samples/broadcast/src/main/java/com/glines/socketio/sample/broadcast/BroadcastSocketServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void broadcast(int messageType, String message) {
7474
}
7575

7676
@Override
77-
protected SocketIOInbound doSocketIOConnect(HttpServletRequest request, String[] protocols) {
77+
protected SocketIOInbound doSocketIOConnect(HttpServletRequest request) {
7878
return new BroadcastConnection();
7979
}
8080

samples/chat-gwt/src/main/java/com/glines/socketio/sample/gwtchat/GWTChatSocketServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private void broadcast(int messageType, String message) {
117117
}
118118

119119
@Override
120-
protected SocketIOInbound doSocketIOConnect(HttpServletRequest request, String[] protocols) {
120+
protected SocketIOInbound doSocketIOConnect(HttpServletRequest request) {
121121
return new GWTChatConnection();
122122
}
123123

samples/chat/src/main/java/com/glines/socketio/sample/chat/ChatSocketServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private void broadcast(int messageType, String message) {
151151
}
152152

153153
@Override
154-
protected SocketIOInbound doSocketIOConnect(HttpServletRequest request, String[] protocols) {
154+
protected SocketIOInbound doSocketIOConnect(HttpServletRequest request) {
155155
return new ChatConnection();
156156
}
157157

samples/echo/src/main/java/com/glines/socketio/sample/echo/EchoSocketServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void onMessage(int messageType, String message) {
5858
}
5959

6060
@Override
61-
protected SocketIOInbound doSocketIOConnect(HttpServletRequest request, String[] protocols) {
61+
protected SocketIOInbound doSocketIOConnect(HttpServletRequest request) {
6262
return new EchoConnection();
6363
}
6464

0 commit comments

Comments
 (0)