I just noticed that my code is actually still just using the Elemental
library:

Here is my initiatlisation code to setup a websocket.
// *websocket* protocol is either *ws* or *wss*, so we just strip *http*
from the document *url*
*final* String url = "ws" + GWT.*getHostPageBaseURL*().substring(4) +
"api/monitor";
*this*.socket = Browser.*getWindow*().newWebSocket(url);
*this*.socket.setOnopen(event -> {
// for some reason this can only be set after the socket is opened
*this*.socket.setOnmessage(event2 -> this.onEvent((MessageEvent) event2));
});
*this*.socket.setOnerror(*this*::onWebSocketError);
*this*.socket.setOnclose(*this*::onWebSocketClose);

The onEvent method just uses GWT jackson to decode the JSON data payload:

*final* MyEventType event = *this*.mapper.read((String) pEvent.getData());
The error and close handlers just try to setup the websocket at regular
intervals (when the server restarts).


On Mon, Jan 16, 2017 at 6:13 AM, Srini v <[email protected]> wrote:

> Hi,
> Do you have an example demonstrating that please?
>
>  Many thanks
>
> On Sat, 24 Dec 2016 09:09 David, <[email protected]> wrote:
>
>> I am using gwt-jackson in combination with Websockets. I just created a
>> JsInterop mapping to the browser native api. Very little code needed.
>>
>>
>> On Fri, 23 Dec 2016 at 20:32, Evan Ruff <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I've been away from GWT for a bit and am looking into creating an
>>> embeeded jCEF project using a Jetty Backend and a Chromium Browser. I was
>>> wondering if there were any libraries out there to help integrate the GWT
>>> client side with the HTTP/2 Server Push features of Jetty 9 (and later
>>> Servlet 4)?
>>>
>>> I'd like to use something like RESTEasy with GWTRestly to do the actual
>>> data mapping, but was hoping for some information about how other people
>>> had approached the problem.
>>>
>>> Thanks for any insight!
>>>
>>> E
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>> You received this message because you are subscribed to the Google
>>> Groups "GWT Users" group.
>>>
>>>
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>>
>>>
>>> To post to this group, send email to [email protected]
>>> .
>>>
>>>
>>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>>>
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to