Skip to content

Commit 9be98b3

Browse files
committed
Merge pull request clwillingham#4 from fredsa/patch-1
Ensure that we pass in the current endpoint (webSocket.getNamespace())
2 parents 90e010a + ab68620 commit 9be98b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

socket.io.client/src/com/clwillingham/socket/io/IOSocket.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void emit(String event, JSONObject... message) throws IOException {
7272
}
7373
data.put("name", event);
7474
data.put("args", args);
75-
IOMessage packet = new IOMessage(IOMessage.EVENT, "", data.toString());
75+
IOMessage packet = new IOMessage(IOMessage.EVENT, webSocket.getNamespace(), data.toString());
7676
webSocket.sendMessage(packet);
7777
} catch (JSONException e) {
7878
// TODO Auto-generated catch block
@@ -81,15 +81,15 @@ public void emit(String event, JSONObject... message) throws IOException {
8181
}
8282

8383
public void send(String message) throws IOException {
84-
IOMessage packet = new IOMessage(IOMessage.MESSAGE, "", message);
84+
IOMessage packet = new IOMessage(IOMessage.MESSAGE, webSocket.getNamespace(), message);
8585
webSocket.sendMessage(packet);
8686
}
8787

8888
public synchronized void disconnect() {
8989
if (connected) {
9090
try {
9191
if (open) {
92-
webSocket.sendMessage(new IOMessage(IOMessage.DISCONNECT, "", ""));
92+
webSocket.sendMessage(new IOMessage(IOMessage.DISCONNECT, webSocket.getNamespace(), ""));
9393
}
9494
} catch (IOException e) {
9595
e.printStackTrace();

0 commit comments

Comments
 (0)