D
Danny Woods
Hi all,
Bit of an involved problem, this one, so please bear with me.
I have a DatagramSocket in an applet which handles the RTCP channel of an RTP
session. This channel is bi-directional, with very little server->client
communication. On the other hand, Client->server communication amounts to
about 10-20 small packets per second; packet loss on this channel isn't a
particular worry.
During operation, the call to receive will block, as the server won't talk
much. A second thread will call the send method as required on the same socket.
I have observed that this is not a problem: the socket appears to happily
process sends while blocked on the receive.
So here's the question: is the above reliable behaviour? There's no mention
in the documentation that this is ok.
Now, as this is an applet written with minimum browser requirements, it *must*
be written using the 1.1 APIs, thanks to Microsoft's VM. This rules out
java.nio's Selector with a DatagramChannel. I'm also not so happy
with using setSoTimeout() on the DatagramSocket to attempt a read before
handling the send requests, as each receive failure generates an
InterruptedIOException, and generating 10-20 exceptions a second isn't a
particularly efficient use of processor time (and just feels like a hack).
Any comments would be appreciated.
Regards,
Danny.
Bit of an involved problem, this one, so please bear with me.
I have a DatagramSocket in an applet which handles the RTCP channel of an RTP
session. This channel is bi-directional, with very little server->client
communication. On the other hand, Client->server communication amounts to
about 10-20 small packets per second; packet loss on this channel isn't a
particular worry.
During operation, the call to receive will block, as the server won't talk
much. A second thread will call the send method as required on the same socket.
I have observed that this is not a problem: the socket appears to happily
process sends while blocked on the receive.
So here's the question: is the above reliable behaviour? There's no mention
in the documentation that this is ok.
Now, as this is an applet written with minimum browser requirements, it *must*
be written using the 1.1 APIs, thanks to Microsoft's VM. This rules out
java.nio's Selector with a DatagramChannel. I'm also not so happy
with using setSoTimeout() on the DatagramSocket to attempt a read before
handling the send requests, as each receive failure generates an
InterruptedIOException, and generating 10-20 exceptions a second isn't a
particularly efficient use of processor time (and just feels like a hack).
Any comments would be appreciated.
Regards,
Danny.