Issue Details (XML | Word | Printable)

Key: TYRUS-243
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Pavel Bucek
Reporter: jst
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

WebSocketContainer.connectToServer can block for seconds

Created: 26/Aug/13 10:54 AM   Updated: 05/Sep/13 07:53 AM   Resolved: 03/Sep/13 01:16 PM
Component/s: client
Affects Version/s: 1.2.1
Fix Version/s: 1.3

Time Tracking:
Not Specified

Participants: jst and Pavel Bucek

 Description  « Hide

I am using Tyrus Client to connect to a chess server via WebSocket protocol. There is a input field that allows the user to specify the URL and button "Connect" that tries to open the connection. Alas, if the URL is mistyped, it takes seconds for the method connectToServer to return. For the whole time the UI is blocked.

I have workarounded that by doing to WebSocketContainer.connectToServer call in different thread. But that is not very comfortable (given the fact that the rest of the API - e.g. @OnOpen, @OnError, @OnMessage, @OnClose is well designed to not require me to care about launching threads) and certainly it is much less usable than the JavaScript WebSockets specification:

In JavaScript one can do new WebSocket("ws://...") - the system just checks the URL is syntactically OK and returns immediately. Failure to connect would be notified to @OnError method.

A really non-blocking "connect" method would be nice.

No work has yet been logged on this issue.