Skip to content

Commit

Permalink
Added listener event for connecting to endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinay S Shenoy committed May 20, 2013
1 parent e1877d6 commit b7e9b76
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/com/codebutler/android_websockets/SocketIOClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class SocketIOClient {
public static interface Handler {
public void onConnect();

public void onConnectToEndpoint(String endpoint);

public void on(String event, JSONArray arguments);

public void onDisconnect(int code, String reason);
Expand Down Expand Up @@ -142,7 +144,11 @@ public void onMessage(String message) {
switch (code) {
case 1:
// connect
mHandler.onConnect();
if (!TextUtils.isEmpty(parts[2])) {
mHandler.onConnectToEndpoint(parts[2]);
} else {
mHandler.onConnect();
}
break;
case 2:
// heartbeat
Expand Down

0 comments on commit b7e9b76

Please sign in to comment.