java threads!!!

P

pavs

hey..

Can a thread read from two ports simultaneously ( in java)????

Also how can i change the port to which a thread is listening to
dynamically, if at all it can be done (in java)???
 
S

Stefan Schulz

hey..

Can a thread read from two ports simultaneously ( in java)????

Also how can i change the port to which a thread is listening to
dynamically, if at all it can be done (in java)???

While i am not sure what exactly you mean, i guess you have so far created
threads that do nothing more then reading input from one Socket object. If
this is the case, take a look at the java.nio package.
 
J

John C. Bollinger

pavs said:
Can a thread read from two ports simultaneously ( in java)????

In any language, one thread does exactly one thing at a time. That's a
key part of the definition of the concept.
Also how can i change the port to which a thread is listening to
dynamically, if at all it can be done (in java)???

There is no answer to the question at this level of generality. You
must first define rather specifically -- best by means of source code --
what it means for a thread to be "listening" to a "port".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top