fix #7 getter for Manager(io)
This commit is contained in:
@@ -72,7 +72,7 @@ public class Socket extends Emitter {
|
|||||||
private boolean disconnected = true;
|
private boolean disconnected = true;
|
||||||
private int ids;
|
private int ids;
|
||||||
private String nsp;
|
private String nsp;
|
||||||
/*package*/ Manager io;
|
private Manager io;
|
||||||
private Map<Integer, Ack> acks = new HashMap<Integer, Ack>();
|
private Map<Integer, Ack> acks = new HashMap<Integer, Ack>();
|
||||||
private Queue<On.Handle> subs;
|
private Queue<On.Handle> subs;
|
||||||
private final Queue<List<Object>> receiveBuffer = new LinkedList<List<Object>>();
|
private final Queue<List<Object>> receiveBuffer = new LinkedList<List<Object>>();
|
||||||
@@ -407,6 +407,10 @@ public class Socket extends Emitter {
|
|||||||
return this.close();
|
return this.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Manager io() {
|
||||||
|
return io;
|
||||||
|
}
|
||||||
|
|
||||||
private static Object[] toArray(JSONArray array) {
|
private static Object[] toArray(JSONArray array) {
|
||||||
int length = array.length();
|
int length = array.length();
|
||||||
Object[] data = new Object[length];
|
Object[] data = new Object[length];
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ public class ConnectionTest extends Connection {
|
|||||||
public void reconnectByDefault() throws URISyntaxException, InterruptedException {
|
public void reconnectByDefault() throws URISyntaxException, InterruptedException {
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
socket = client();
|
socket = client();
|
||||||
socket.io.on(Manager.EVENT_RECONNECT, new Emitter.Listener() {
|
socket.io().on(Manager.EVENT_RECONNECT, new Emitter.Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void call(Object... objects) {
|
public void call(Object... objects) {
|
||||||
socket.close();
|
socket.close();
|
||||||
@@ -208,7 +208,7 @@ public class ConnectionTest extends Connection {
|
|||||||
new Timer().schedule(new TimerTask() {
|
new Timer().schedule(new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
socket.io.engine.close();
|
socket.io().engine.close();
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
latch.await();
|
latch.await();
|
||||||
@@ -229,7 +229,7 @@ public class ConnectionTest extends Connection {
|
|||||||
new Timer().schedule(new TimerTask() {
|
new Timer().schedule(new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
socket.io.engine.close();
|
socket.io().engine.close();
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
latch.await();
|
latch.await();
|
||||||
|
|||||||
Reference in New Issue
Block a user