Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Java App freezes when client.connect is called
January 18, 2019
15:59, EET
Avatar
wyattetal
New Member
Members
Forum Posts: 1
Member Since:
January 18, 2019
sp_UserOfflineSmall Offline

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.

January 18, 2019
16:32, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Helsinki

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, howardkennerley

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1