Pavel,
Sorry for the delay.
Attached is the WebsocketWrapper I am using for Android. The wrapper
maintains a queue for outgoing messages and sends them from a separate
long-running thread. This is necessary because Android does not allow
network operations on the main thread. I have tried to snip out
irrelevant portions to simplify.
MyEndpoint is a basic implementation of ClientEndpoint. SettableBoolean
is just a class with a boolean member used for the synchronization. The
WebsocketFailureListener is an interface with the function
onConnectionFailure.
Code to instantiate and run:
websocketWrapper = new WebsocketWrapper();
websocketWrapper.setFailureListener(handler);
websocketWrapper.setConnectionURI(connectionURI);
new Thread(websocketWrapper).start();
I have not had time to test other platforms yet.
Thanks,
Matt
On 10/16/2014 02:29 PM, Pavel Bucek wrote:
> Hi Matt,
>
> there is just this [1] small "fix", which might cause described
> behavior.. Can you reproduce it on different platform? (ideally
> standard Java SE 7/8/9); if not, can you please share exact code which
> would reproduce the issue? (it does not need to be complete project,
> code snippet should be enough).
>
> Thanks,
> Pavel
>
>
> [1]
> https://github.com/tyrus-project/tyrus/commit/9f05c64f7b3747e247feb97f8a8983fe88488831
>
> On 16/10/14 18:16, Matthew Mah wrote:
>> With the tyrus-standalone-client version 1.8.3 on an Android Galaxy
>> Nexus, I encounter problems with closing connections, either
>> executing close() or when a timeout or connection failure occurs.
>> With both of these, the onClose method of the ClientEndpoint is not
>> called. With 1.8.2, both of these conditions result in the onClose
>> method being called. Has there been a major change, or is this a new
>> bug in 1.8.3?
>>
>> Thanks,
>> Matt
>