Re: java socket i/o with callback/non-blocking
- From: "Shane Wealti" <shanewealti@xxxxxxxxx>
- Date: 14 Jun 2005 10:21:39 -0700
You're right, that sounds more like what I'm looking for.
So I'll have my i/o thread that will issue a read command which will
block (allowing other threads to run) while it is waiting for input.
When there are incoming bytes to read in the socket's buffer, the i/o
thread will automatically become unblocked/wake up and I can process
the bytes and eventually issue another read command. What if I need to
write to the socket while it is blocked on a read? Should I create
another thread for the writing (which means I have to worry about
deadlock/race conditions, right?) or can I somehow interrupt the
thread, abort the blocked read command and write instead? Am I on the
right track at all here?
.
- Follow-Ups:
- Re: java socket i/o with callback/non-blocking
- From: Shane Wealti
- Re: java socket i/o with callback/non-blocking
- From: Bjorn Borud
- Re: java socket i/o with callback/non-blocking
- References:
- java socket i/o with callback/non-blocking
- From: Shane Wealti
- Re: java socket i/o with callback/non-blocking
- From: John C. Bollinger
- java socket i/o with callback/non-blocking
- Prev by Date: Re: Shortage of qualified Java programmers
- Next by Date: Re: Better Java error messages
- Previous by thread: Re: java socket i/o with callback/non-blocking
- Next by thread: Re: java socket i/o with callback/non-blocking
- Index(es):
Relevant Pages
|