fix #7 getter for Manager(io)

This commit is contained in:
Naoyuki Kanezawa
2014-07-13 08:32:08 +09:00
parent 289b282a76
commit 98a3eb8777
2 changed files with 8 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ public class Socket extends Emitter {
private boolean disconnected = true;
private int ids;
private String nsp;
/*package*/ Manager io;
private Manager io;
private Map<Integer, Ack> acks = new HashMap<Integer, Ack>();
private Queue<On.Handle> subs;
private final Queue<List<Object>> receiveBuffer = new LinkedList<List<Object>>();
@@ -407,6 +407,10 @@ public class Socket extends Emitter {
return this.close();
}
public Manager io() {
return io;
}
private static Object[] toArray(JSONArray array) {
int length = array.length();
Object[] data = new Object[length];

View File

@@ -197,7 +197,7 @@ public class ConnectionTest extends Connection {
public void reconnectByDefault() throws URISyntaxException, InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
socket = client();
socket.io.on(Manager.EVENT_RECONNECT, new Emitter.Listener() {
socket.io().on(Manager.EVENT_RECONNECT, new Emitter.Listener() {
@Override
public void call(Object... objects) {
socket.close();
@@ -208,7 +208,7 @@ public class ConnectionTest extends Connection {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
socket.io.engine.close();
socket.io().engine.close();
}
}, 500);
latch.await();
@@ -229,7 +229,7 @@ public class ConnectionTest extends Connection {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
socket.io.engine.close();
socket.io().engine.close();
}
}, 500);
latch.await();