Tabnine Logo
Message.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.wizzardo.http.websocket.Message
constructor

Best Java code snippets using com.wizzardo.http.websocket.Message.<init> (Showing top 5 results out of 315)

origin: wizzardo/http

public void broadcast(byte[] bytes, int offset, int length) {
  broadcast(new Message(bytes, offset, length));
}
origin: wizzardo/http

public void broadcast(CommandPojo command) {
  broadcast(new Message()
      .append(command.getClass().getSimpleName())
      .append(JsonTools.serializeToBytes(command))
  );
}
origin: com.wizzardo/simple-websocket-client

out.flush();
message = new Message();
limit = 0;
int response = 0;
origin: com.wizzardo/simple-websocket-client

public void waitForMessage() throws IOException {
  if (!connectIfNot())
    return;
  while (!message.isComplete()) {
    if (!onFrame(readFrame()))
      break;
  }
  if (!message.isComplete())
    return;
  try {
    onMessage(message);
  } catch (Exception e) {
    onError(e);
  }
  message = new Message();
}
origin: wizzardo/http

@Test
public void testFrames() throws IOException, URISyntaxException, InterruptedException {
  handler = new WebSocketHandler() {
    @Override
    public void onMessage(WebSocketListener listener, Message message) {
      listener.sendMessage(message);
    }
  };
  AtomicReference<String> messageHolder = new AtomicReference<>();
  SimpleWebSocketClient client = new SimpleWebSocketClient("ws://localhost:" + getPort()) {
    @Override
    public void onMessage(Message message) {
      messageHolder.set(message.asString());
    }
  };
  Message message = new Message().append("foo").append(" ").append("bar");
  client.send(message);
  client.waitForMessage();
  Assert.assertEquals("foo bar", messageHolder.get());
}
com.wizzardo.http.websocketMessage<init>

Popular methods of Message

  • append
  • add
  • asBytes
  • getFrames
  • isComplete
  • asString
  • clear
  • getBytesLength

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • ImageIO (javax.imageio)
  • JComboBox (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now