Skip to content

Commit 7f7ab05

Browse files
committed
add send(JSONObject) overload, with an endpoint String param
1 parent 693327c commit 7f7ab05

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ public void emit(String event, JSONObject... message) throws IOException, Interr
8080
}
8181
}
8282

83+
public void send(String endpoint, JSONObject message) throws IOException, InterruptedException {
84+
IOMessage packet = new IOMessage(IOMessage.JSONMSG, endpoint, message.toString());
85+
webSocket.sendMessage(packet);
86+
}
87+
8388
public void send(String message) throws IOException, InterruptedException {
8489
IOMessage packet = new IOMessage(IOMessage.MESSAGE, "", message);
8590
webSocket.sendMessage(packet);

src/main/java/com/clwillingham/socket/io/IOWebSocket.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public IOWebSocket(URI arg0, IOSocket ioSocket, MessageCallback callback) {
2828
@Override
2929
public void onError(Exception arg0) {
3030
// TODO Auto-generated method stub
31+
arg0.printStackTrace();
3132

3233
}
3334

0 commit comments

Comments
 (0)