[2351] in java-interest
Re: What am I doing Wrong?
daemon@ATHENA.MIT.EDU (Thomas Ball)
Fri Sep 29 17:44:51 1995
Date: Fri, 29 Sep 1995 12:38:24 -0700
From: Thomas.Ball@Eng.Sun.COM (Thomas Ball)
To: jones@iwn.com
Cc: java-interest@java.Eng.Sun.COM
The run() method is only invoked once, and the new thread needs to control
its destiny from there. Put your code inside a "while (true)" block, or
something more sophisticated if your application warrants it.
Tom
> From daemon@java Fri Sep 29 05:31:00 1995
> To: "'Java Interest Mailing List'" <java-interest@java@sun.com>
> Subject: What am I doing Wrong?
> X-Info: To unsubscribe, send 'unsubscribe' to java-interest-request@java.sun.com
>
> HI,
>
> I'm writting a small applet that needs to talk to a server once very n =
> seconds.The way I envisioned the code working is something like this:
>
> public void run() {
> make connection to server
> request data
> close connection to server
> process request
> repaint()
> sleep thread n seconds
> }
>
> Unfortunately this only happens once. What is wrong. (Even if I take out =
> the sleep thread part, it still only executes the run method once.)
>
> thanx
> joe
>
> -
> Note to Sun employees: this is an EXTERNAL mailing list!
> Info: send 'help' to java-interest-request@java.sun.com
>
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com