sending on socket with blocked read; any synchronized problem?

Discussion in 'Java' started by Ong Hong Peow, Aug 19, 2004.

  1. Hi,

    I'm not sure if there's a synchronizing problem ... or is it legit op:

    At all times, there's a block read( byte[] ) using the InputStream from a
    socket on a separate read thread.
    On another thread, I'm intending to send out data using the same socket in
    question.

    is there any issue on such operations?
    e.g in the mist of sending out data streams on the socket, there's incoming
    streams on the blocked read.


    Thanks.
     
    Ong Hong Peow, Aug 19, 2004
    #1
    1. Advertising

  2. On Thu, 19 Aug 2004 12:30:38 +0800, Ong Hong Peow wrote:
    > At all times, there's a block read( byte[] ) using the InputStream
    > from a socket on a separate read thread. On another thread, I'm
    > intending to send out data using the same socket in question.
    >
    > is there any issue on such operations?


    Please don't multipost.

    There are no issues. As far as the application is concerned, the
    socket connection consists of two completely independent streams.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Aug 19, 2004
    #2
    1. Advertising

  3. Ong Hong Peow

    xarax Guest

    "Gordon Beaton" <> wrote in message
    news:41244870$...
    > On Thu, 19 Aug 2004 12:30:38 +0800, Ong Hong Peow wrote:
    > > At all times, there's a block read( byte[] ) using the InputStream
    > > from a socket on a separate read thread. On another thread, I'm
    > > intending to send out data using the same socket in question.
    > >
    > > is there any issue on such operations?

    >
    > Please don't multipost.
    >
    > There are no issues. As far as the application is concerned, the
    > socket connection consists of two completely independent streams.


    I am using SocketChannel for bi-directional TCP/IP
    message packets with separate threads for input
    and output, and blocking I/O. It works fine for me
    at JRE 1.4.2 level.

    --
    ----------------------------
    Jeffrey D. Smith
    Farsight Systems Corporation
    24 BURLINGTON DRIVE
    LONGMONT, CO 80501-6906
    http://www.farsight-systems.com
    z/Debug debugs your Systems/C programs running on IBM z/OS for FREE!
     
    xarax, Aug 19, 2004
    #3
  4. Thanks Gordon for the clarification.

    "Gordon Beaton" <> wrote in message
    news:41244870$...
    > On Thu, 19 Aug 2004 12:30:38 +0800, Ong Hong Peow wrote:
    > > At all times, there's a block read( byte[] ) using the InputStream
    > > from a socket on a separate read thread. On another thread, I'm
    > > intending to send out data using the same socket in question.
    > >
    > > is there any issue on such operations?

    >
    > Please don't multipost.
    >
    > There are no issues. As far as the application is concerned, the
    > socket connection consists of two completely independent streams.
    >
    > /gordon
    >
    > --
    > [ do not email me copies of your followups ]
    > g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Ong Hong Peow, Aug 25, 2004
    #4
    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. Jerry
    Replies:
    4
    Views:
    131,916
    tonni
    Aug 11, 2010
  2. Pep
    Replies:
    6
    Views:
    29,322
  3. dmcreyno
    Replies:
    9
    Views:
    9,590
    Mark Space
    Jun 27, 2006
  4. Yim

    How to awake blocked socket read?

    Yim, Feb 21, 2005, in forum: C Programming
    Replies:
    1
    Views:
    334
    Joona I Palaste
    Feb 21, 2005
  5. ankur
    Replies:
    4
    Views:
    1,466
    Eric Sosman
    Nov 28, 2008
Loading...

Share This Page