15:59, EET
January 18, 2019
Apologies for a newbie question; I did search for an answer but came up empty…
I am finding that my Java app freezes completely for about five seconds when client.connect is called and eventually fails with connect exception and service exception.
(Connect to a live service works fine; I am concerned here with trying to establish initial contact to a server that may or may not be running)
Is there a less disruptive way to inspect a URI before calling connect?
Is there a common mistake I might be making that would lead to this behavior?
Thanks for the help.
16:32, EET
April 3, 2012
Hi,
Assuming your app is a graphical one, this can happen if you call the connect on the UI toolkit Thread. It will wait untill it has timed out (and prevents the UI toolkit to do other stuff, which in most cases will lead the OS to assume your application has crashed) if there is no server in the other end. Easiest solution at the moment is to use a different Thread to make the connect call and display the results when it returns.
Most Users Ever Online: 1919
Currently Online:
61 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 737
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1524
Posts: 6450
Newest Members:
fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerleyModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1