Skip to content

Instantly share code, notes, and snippets.

View jumperchen's full-sized avatar

Jumper Chen jumperchen

View GitHub Profile
@jumperchen
jumperchen / TestOKHttp.java
Created May 3, 2017 07:21
onClosing : 1001 reason
import java.util.concurrent.TimeUnit;
import okio.ByteString;
public class TestOKHttp {
private static OkHttpClient client;
private static WebSocket ws;
private static boolean success = false;
@jumperchen
jumperchen / socket-cheatsheet.js
Created December 22, 2017 07:18 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender