};
} else {
return new WaveSocket() {
final WebSocket socket = new WebSocket(new WebSocketCallback() {
@Override
public void onConnect() {
callback.onConnect();
}
@Override
public void onDisconnect() {
callback.onDisconnect();
}
@Override
public void onMessage(String message) {
callback.onMessage(message);
}
});
@Override
public void connect() {
socket.connect(urlBase + "socket");
}
@Override
public void disconnect() {
socket.close();
}
@Override
public void sendMessage(String message) {
socket.send(message);
}
};
}
}