Esempio n. 1
0
 /**
  * Closes the WebSocket connection or connection attempt, if any. If the connection is already
  * {@link #CLOSED}, this method does nothing.
  *
  * @param code A numeric value indicating the status code explaining why the connection is being
  *     closed
  * @param reason A human-readable string explaining why the connection is closing
  */
 @JsxFunction
 public void close(final Object code, final Object reason) {
   if (incomingConnection_ != null) {
     incomingConnection_.close();
   }
   if (outgoingConnection_ != null) {
     outgoingConnection_.close();
   }
 }