AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Thread question

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Jova
Guest





PostPosted: Sun Oct 15, 2006 8:57 pm    Post subject: Thread question Reply with quote



I have a client running and it implemenets Runnable, I want it to connect
to a server at certain time intervals to retrieve data. How can this be
accomplished?
Back to top
Matt Humphrey
Guest





PostPosted: Sun Oct 15, 2006 11:35 pm    Post subject: Re: Thread question Reply with quote



"Jova" <jova (AT) nospam (DOT) net> wrote in message
news:TTsYg.3962$ON3.186 (AT) newsfe10 (DOT) lga...
Quote:
I have a client running and it implemenets Runnable, I want it to connect
to a server at certain time intervals to retrieve data. How can this be
accomplished?

The fact that it implements Runnable doesn't necessarily mean anything here.
To have your client periodically connect to a server look at
java.util.Timer. Have the timer execute a timer task that does your client
connection operation. This may in turn require a Runnable, but it doesn't
have to be (and is probably best if it is not) a Runnable of your client.
Don't forget that you will probably need some kind of synchronization such
that when the task is executing, it doesn't conflict with whatever else the
client may be doing.

Matt Humphrey matth (AT) ivizNOSPAM (DOT) com http://www.iviz.com /
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.