src/main/java/pityoulish/sockets/server/SimplisticSocketHandler.java
public void sendErrorAndClose(Throwable cause, Socket sock)
  {
    if (sock != null)
     {
       try {
         ByteBuffer response = reqHandler.buildErrorResponse(cause);
         sendResponse(sock, response);
       } catch (Exception ignore) {
         cause.addSuppressed(ignore);
       }
       try {
         sock.close();
       } catch (Exception ignore) {
         cause.addSuppressed(ignore);
       }
     }
  }
/**
   * Sends an error response and closes the socket.
   * Does nothing if <code>sock</code> is <code>null</code>.
   *
   * @param cause       an exception indicating the cause of the problem
   * @param sock        the socket on which to respond, or <code>null</code>
   */
Sends an error response and closes the socket.
Does nothing if sock is null.

@param cause       an exception indicating the cause of the problem
@param sock        the socket on which to respond, or null
Sends an error response and closes the socket . Does nothing if sock is null . @param cause an exception indicating the cause of the problem @param sock the socket on which to respond or null
public void sendErrorAndClose(Throwable cause, Socket sock)
  {
    if (sock != null)
     {
       try {
         ByteBuffer response = reqHandler.buildErrorResponse(cause);
         sendResponse(sock, response);
       } catch (Exception ignore) {
         cause.addSuppressed(ignore);
       }
       try {
         sock.close();
       } catch (Exception ignore) {
         cause.addSuppressed(ignore);
       }
     }
  }
public void sendErrorAndClose ( Throwable cause , Socket sock ) { if ( sock != null ) { try { ByteBuffer response = reqHandler . buildErrorResponse ( cause ) ; sendResponse ( sock , response ) ; } catch ( Exception ignore ) { cause . addSuppressed ( ignore ) ; } try { sock . close ( ) ; } catch ( Exception ignore ) { cause . addSuppressed ( ignore ) ; } } }
Sends an error response and closes the socket.
Sends an error response and closes the socket .