MCPcopy
hub / github.com/socketio/socket.io-client-java / close

Method close

src/main/java/io/socket/client/Socket.java:461–480  ·  view source on GitHub ↗

Disconnects the socket. @return a reference to this object.

()

Source from the content-addressed store, hash-verified

459 * @return a reference to this object.
460 */
461 public Socket close() {
462 EventThread.exec(new Runnable() {
463 @Override
464 public void run() {
465 if (Socket.this.connected) {
466 if (logger.isLoggable(Level.FINE)) {
467 logger.fine(String.format("performing disconnect (%s)", Socket.this.nsp));
468 }
469 Socket.this.packet(new Packet(Parser.DISCONNECT));
470 }
471
472 Socket.this.destroy();
473
474 if (Socket.this.connected) {
475 Socket.this.onclose("io client disconnect");
476 }
477 }
478 });
479 return this;
480 }
481
482 /**
483 * Disconnects the socket.

Callers 15

disconnectMethod · 0.95
callMethod · 0.45
connectToLocalhostMethod · 0.45
workWithAcksMethod · 0.45
receiveDateWithAckMethod · 0.45
sendBinaryAckMethod · 0.45
workWithFalseMethod · 0.45
callMethod · 0.45

Calls 1

execMethod · 0.80

Tested by 15

callMethod · 0.36
connectToLocalhostMethod · 0.36
workWithAcksMethod · 0.36
receiveDateWithAckMethod · 0.36
sendBinaryAckMethod · 0.36
workWithFalseMethod · 0.36
callMethod · 0.36
runMethod · 0.36