Example usage for com.google.gwt.websocket.client SocketMessage create

List of usage examples for com.google.gwt.websocket.client SocketMessage create

Introduction

In this page you can find the example usage for com.google.gwt.websocket.client SocketMessage create.

Prototype

public static final native SocketMessage create(String message) ;

Source Link

Usage

From source file:org.rest.client.activity.SocketActivity.java

License:Apache License

@Override
public void sendMessage(String message) {
    if (socket == null) {
        StatusNotification.notify("Socket not ready", StatusNotification.TYPE_ERROR,
                StatusNotification.TIME_SHORT);
        return;//from w  w  w  .  j  a  v  a  2 s .  com
    }
    SocketMessage msg = SocketMessage.create(message);
    messages.add(msg);
    try {
        socket.send(message);
    } catch (Exception e) {
        messages.remove(msg);
        Log.error("Unable sent socket message", e);
        StatusNotification.notify("Unable sent socket message.", StatusNotification.TYPE_ERROR,
                StatusNotification.TIME_SHORT);
    }
}