Rob Brew
Ranch Hand
Posts: 101
Rob Brew
Ranch Hand
Posts: 101
Rob Brew
Ranch Hand
Posts: 101
posted 6 years ago
Matthew is still right. Your connect() method contains a while (true) loop that only ends when an exception occurs, and therefore the entire method will only end when an exception occurs.
Other than that, you will overwrite reader and writer for every new connection. They should become local variables instead, which you then pass to the runnables:
Now each connection will have its own reader/writer pair and its own handling threads.
Other than that, you will overwrite reader and writer for every new connection. They should become local variables instead, which you then pass to the runnables:
Now each connection will have its own reader/writer pair and its own handling threads.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions

She still doesn't approve of my superhero lifestyle. Or this shameless plug:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
|