code: private byte readChunk() throws IOException {
      try {
        return readChunkImpl();
      } catch (SocketException ex) {
        // Some stream implementations may throw SocketException and not EOFException when socket is
        // terminated by
        // application
        // By common agreement, rethrow it as EOFException and let an upstream handler take care.
        synchronized (orchestratorEvent) {
          if (shutdown) {
            EOFException newException = new EOFException("NGCommunicator is shutting down");
            newException.initCause(ex);
            throw newException;
          }
        }
        throw ex;
      }
    }
docs: Reads a NailGun chunk header from the underlying InputStream.
  
  @return type of chunk received
  @throws EOFException if underlying stream / socket is closed which happens on client
  disconnection or server closure
  @throws IOException if thrown by the underlying InputStream, or if an unexpected NailGun chunk
  type is encountered.