code: private void checkNoReturnedData(Socket socket) throws IOException {
  		final InputStream input = socket.getInputStream();
  		if (input.available() > 0) {
  			final byte[] bytes = new byte[1000];
  			final int toRead = Math.min(input.available(), bytes.length);
  			final int read = input.read(bytes, 0, toRead);
  			if (read > 0) {
  				final String msg = "Data returned by graphite server when expecting no response! "
  						+ "Probably aimed at wrong socket or server. Make sure you "
  						+ "are publishing to the data port, not the dashboard port. First " + read
  						+ " bytes of response: " + new String(bytes, 0, read, "UTF-8");
  				LOG.warn(msg, new IOException(msg));
  			}
  		}
  	}
docs: The graphite protocol is a "one-way" streaming protocol and as such there is no easy way
  to check that we are sending the output to the wrong place. We can aim the graphite writer
  at any listening socket and it will never care if the data is being correctly handled. By
  logging any returned bytes we can help make it obvious that it's talking to the wrong
  server/socket. In particular if its aimed at the web port of a
  graphite server this will make it print out the HTTP error message.
  @param socket Socket
  @throws IOException e