A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Stan James:
Yup, show us where you're going in a little more detail. You can't have multiple threads reading from the same socket at the same time. But you could have a driver that reads a message and hands it off to a thread for handling. The driver could read at the speed of the network and not be slowed down by the server code that runs in response to each message.
The logic would be something like:
Hmmm, there must be a cleane way to say that without three reads. Lemme know if that's going the right direction.
If you get tons of messages faster than you can handle them you'll wind up with tons of threads which could be very bad. If the number of threads or the overhead of creating them becomes a problem, look into thread pools. The Jakarta Commons has a nice one.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
SCJP2. Please Indent your code using UBB Code
Don't get me started about those stupid light bulbs. |