Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > sending on socket with blocked read; any synchronized problem?

Reply
Thread Tools

sending on socket with blocked read; any synchronized problem?

 
 
Ong Hong Peow
Guest
Posts: n/a
 
      08-19-2004
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.


 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      08-19-2004
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
 
Reply With Quote
 
 
 
 
xarax
Guest
Posts: n/a
 
      08-19-2004
"Gordon Beaton" <(E-Mail Removed)> wrote in message
news:41244870$(E-Mail Removed)...
> 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!



 
Reply With Quote
 
Ong Hong Peow
Guest
Posts: n/a
 
      08-25-2004
Thanks Gordon for the clarification.

"Gordon Beaton" <(E-Mail Removed)> wrote in message
news:41244870$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Site to open the blocked sites and blocked and encoded alagmy2030 Javascript 0 02-11-2011 11:54 PM
Synchronized Block v.s. Synchronized Method Jerry Java 4 08-11-2010 02:34 PM
Question on synchronized and non synchronized methods ankur Java 4 11-28-2008 09:56 PM
synchronized block in synchronized static method dmcreyno Java 9 06-27-2006 07:43 PM
Use of synchronized variables over synchronized methods? Pep Java 6 08-15-2005 01:29 PM



Advertisments