Merge branch 'master' into fix/compatible-v2
This commit is contained in:
@@ -262,7 +262,9 @@ public class Socket extends Emitter {
|
||||
}
|
||||
|
||||
private void onclose(String reason) {
|
||||
logger.fine(String.format("close (%s)", reason));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("close (%s)", reason));
|
||||
}
|
||||
this.connected = false;
|
||||
this.id = null;
|
||||
this.emit(EVENT_DISCONNECT, reason);
|
||||
@@ -316,7 +318,9 @@ public class Socket extends Emitter {
|
||||
|
||||
private void onevent(Packet<JSONArray> packet) {
|
||||
List<Object> args = new ArrayList<Object>(Arrays.asList(toArray(packet.data)));
|
||||
logger.fine(String.format("emitting event %s", args));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("emitting event %s", args));
|
||||
}
|
||||
|
||||
if (packet.id >= 0) {
|
||||
logger.fine("attaching ack callback to event");
|
||||
@@ -343,7 +347,9 @@ public class Socket extends Emitter {
|
||||
public void run() {
|
||||
if (sent[0]) return;
|
||||
sent[0] = true;
|
||||
logger.fine(String.format("sending ack %s", args.length != 0 ? args : null));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("sending ack %s", args.length != 0 ? args : null));
|
||||
}
|
||||
|
||||
JSONArray jsonArgs = new JSONArray();
|
||||
for (Object arg : args) {
|
||||
@@ -362,10 +368,14 @@ public class Socket extends Emitter {
|
||||
private void onack(Packet<JSONArray> packet) {
|
||||
Ack fn = this.acks.remove(packet.id);
|
||||
if (fn != null) {
|
||||
logger.fine(String.format("calling ack %s with %s", packet.id, packet.data));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("calling ack %s with %s", packet.id, packet.data));
|
||||
}
|
||||
fn.call(toArray(packet.data));
|
||||
} else {
|
||||
logger.fine(String.format("bad ack %s", packet.id));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("bad ack %s", packet.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,7 +401,9 @@ public class Socket extends Emitter {
|
||||
}
|
||||
|
||||
private void ondisconnect() {
|
||||
logger.fine(String.format("server disconnect (%s)", this.nsp));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("server disconnect (%s)", this.nsp));
|
||||
}
|
||||
this.destroy();
|
||||
this.onclose("io server disconnect");
|
||||
}
|
||||
@@ -418,7 +430,9 @@ public class Socket extends Emitter {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Socket.this.connected) {
|
||||
logger.fine(String.format("performing disconnect (%s)", Socket.this.nsp));
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(String.format("performing disconnect (%s)", Socket.this.nsp));
|
||||
}
|
||||
Socket.this.packet(new Packet(Parser.DISCONNECT));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user