Please consider registering

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, EEST
New Member
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, EEST
Bjarne Boström
Forum Posts: 382
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline


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: 78

Currently Online:
19 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 89

pramanj: 86

ibrahim: 68

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 36

Rainer Versteeg: 32

peterrob45: 25

Member Stats:

Guest Posters: 0

Members: 857

Moderators: 12

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 872

Posts: 3676

Newest Members:

virgie88y3407, bennetcole, timbo, malissa6674, Markus Johansson, jonathancamp, michell9665, bqpkelvin990391, Christopher, HuMa

Moderators: Jouni Aro: 827, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 382, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 15, Markus Johansson: 1

Administrators: admin: 0