dcsimg
run() method of thread not running
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alex_Kirk
Posted On:   Thursday, September 27, 2001 04:30 PM

I've got a program that starts off by instantiating an object whose purpose in life is to run as a thread, listening on a socket and processing data on that socket. I am able to successfully create my object (whose constructor grabs the socket, which works OK), and I get no errors when I call start() on the object. In fact, the next line of code after the start() call exectues just fine. For some reason, though, nothing in the object's run() method runs at all -- including a basic system.out.println("Running...") call I put in to make sure I'd not fouled anything up. Note that the object extends Thread. You can see the code at www.schnarff.com/gnutonic -- the file   More>>

I've got a program that starts off by instantiating an object whose purpose in life is to run as a thread, listening on a socket and processing data on that socket.



I am able to successfully create my object (whose constructor grabs the socket, which works OK), and I get no errors when I call start() on the object. In fact, the next line of code after the start() call exectues just fine.



For some reason, though, nothing in the object's run() method runs at all -- including a basic system.out.println("Running...") call I put in to make sure I'd not fouled anything up. Note that the object extends Thread.



You can see the code at www.schnarff.com/gnutonic -- the files you want are runGnutonic.java, which creates and start() 's the thread, and connectionManager.java, which is the object being created.



Thanks in advance for any input you can give. My e-mail is alex@schnarff.com.



Alex Kirk

   <<Less

Re: run() method of thread not running

Posted By:   Alex_Chaffee  
Posted On:   Thursday, September 27, 2001 07:15 PM

Works for me...

$ java runGnutonic
java.io.FileNotFoundException: .hosts (No such file or directory)
Attempting to connect socket to port 7334...
Connected to socket: port 7334
Gnutonic 0.1 at your service
Connection Manager running...

You should do rm *.class to make sure you're not using outdated class files.


Actually, the above is from your tarball. I just tried to compile the raw files and got a compile error. Looks like you problably do have a stale compile problem.

About | Sitemap | Contact