Simple Java Socket Question
Hi,
I am a Newbie in Java. I have this code Code:
Can I add a function 'connect' in the clientThread class, and call later ct.connect() ?? I tried doing so, but it didn't work, I want to know if it always doesn't work (not be able to connect to the thread after you run it) or because my code is wrong Thanks, Happy New Year |
You cannot call a thread's method from another thread and expect it will affect the target thread.
For an explanation, look for "Threads are not Objects" in http://www.javaworld.com/cgi-bin/mailto/x_java.cgi |
All times are GMT -5. The time now is 03:32 PM. |