code: protected final void sendObjectToSocket(final Object objectToSend) {
          this.sendObjectToSocket(objectToSend, new WriteCallback() {
  
              @Override
              public void writeSuccess() {
                  ServerJSONWebSocketAdapter.LOGGER.debug("Send data to socket: {}", objectToSend);
              }
  
              @Override
              public void writeFailed(Throwable x) {
                  ServerJSONWebSocketAdapter.LOGGER.error("Error sending message to socket", x);
              }
          });
      }
docs: send object to client and serialize it using JSON<br>
  uses a generic callback that prints errors to the log
  
  @param objectToSend the object to send