protected void shutdown(Object quitToken) throws IOException {
    logger.debug("shutdown");

    reader.close();

    // garbage collect the socket
    socketBox.setSocket(null);

    // data sink is shared by all data channels,
    // so should be closed by the last one exiting
    if (quitToken != null) {
      sink.close();
    }
  }