A
Amit
Hi all:
I was wondering if Java took care of the classic problem that is used
to introduce select in unix (as in Stevens book). The problem is of
echo client and server. If suppose the server wants to close down, it
sends a FIN to the client. However, the client may be busy-waiting
for user to enter smth. When user enters smth, the client tries to
write, only to find that the connection has been closed from server's
side. So, we unnecessarily made the user to enter smth. What we want
is that as soon as the FIN comes, we are notified. selects fits here.
select is a fn that is used to listen to one or more descriptors. When
there is data on any one of them, we are notified. This way, as soon
as the server closes down, the client gets to know about it.
Is there smth of this sort in java.
Thanks
Amit
I was wondering if Java took care of the classic problem that is used
to introduce select in unix (as in Stevens book). The problem is of
echo client and server. If suppose the server wants to close down, it
sends a FIN to the client. However, the client may be busy-waiting
for user to enter smth. When user enters smth, the client tries to
write, only to find that the connection has been closed from server's
side. So, we unnecessarily made the user to enter smth. What we want
is that as soon as the FIN comes, we are notified. selects fits here.
select is a fn that is used to listen to one or more descriptors. When
there is data on any one of them, we are notified. This way, as soon
as the server closes down, the client gets to know about it.
Is there smth of this sort in java.
Thanks
Amit