java threads!!!  
Author Message
pavs





PostPosted: 2005-2-23 4:26:00 Top

java-programmer, java threads!!! 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)???

 
Stefan Schulz





PostPosted: 2005-2-23 18:41:00 Top

java-programmer >> java threads!!! On Tue, 22 Feb 2005 12:25:51 -0800, pavs wrote:

> 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.

--
In pioneer days they used oxen for heavy pulling, and when one ox
couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
be trying for bigger computers, but for more systems of computers.
--- Rear Admiral Grace Murray Hopper

 
John C. Bollinger





PostPosted: 2005-2-23 22:13:00 Top

java-programmer >> java threads!!! pavs wrote:

> 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".

--
John Bollinger
email***@***.com