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, EEST
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, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 336
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: 78

Currently Online:
10 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

vonGohren: 25

Member Stats:

Guest Posters: 0

Members: 815

Moderators: 11

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 841

Posts: 3556

Newest Members:

waldlatscher, keithwalmar, shanjaved, opcua-user, DmitryPervukhin, DPer, YeaTeshy, marttin, bouncycastlerentals, Sayan B

Moderators: Jouni Aro: 824, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 336, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 14

Administrators: admin: 0