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: 982
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: 518

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

ibrahim: 75

rocket science: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 709

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1465

Posts: 6252

Newest Members:

christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer, shanonhumphreys, KupimotoblokfuB, tamhollander5, paulinafcf, bridgette18l

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 982, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 319, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1