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

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

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

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:
    3,013
    Jon Skeet
    Oct 24, 2003
  2. Naresh Agarwal

    Green threads in Java

    Naresh Agarwal, Jan 9, 2004, in forum: Java
    Replies:
    2
    Views:
    5,818
    Andrew Thompson
    Jan 9, 2004
  3. dmcreyno

    Java Threads, Oaks

    dmcreyno, Apr 16, 2004, in forum: Java
    Replies:
    0
    Views:
    500
    dmcreyno
    Apr 16, 2004
  4. yoda
    Replies:
    2
    Views:
    653
    =?utf-8?Q?Bj=C3=B6rn_Lindstr=C3=B6m?=
    Aug 1, 2005
  5. Casey Hawthorne
    Replies:
    1
    Views:
    601
    Robert Klemme
    Oct 27, 2006
  6. threads without threads

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

    Java Threads - Get running threads

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