java threads!!!

Discussion in 'Java' started by pavs, Feb 22, 2005.

  1. pavs

    pavs Guest

    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)???
     
    pavs, Feb 22, 2005
    #1
    1. Advertising

  2. 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
     
    Stefan Schulz, Feb 23, 2005
    #2
    1. Advertising

  3. 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
     
    John C. Bollinger, Feb 23, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Renato Battaglia
    Replies:
    3
    Views:
    2,821
    Jon Skeet
    Oct 24, 2003
  2. yoda
    Replies:
    2
    Views:
    463
    =?utf-8?Q?Bj=C3=B6rn_Lindstr=C3=B6m?=
    Aug 1, 2005
  3. threads without threads

    , Aug 27, 2004, in forum: C Programming
    Replies:
    4
    Views:
    432
    William Ahern
    Aug 27, 2004
  4. Pedro Pinto

    Java Threads - Get running threads

    Pedro Pinto, Apr 8, 2008, in forum: Java
    Replies:
    2
    Views:
    1,483
    Arne Vajhøj
    Apr 9, 2008
  5. Une bévue
    Replies:
    0
    Views:
    176
    Une bévue
    Jun 14, 2006
Loading...

Share This Page