harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject [classlib][nio][question] Peek on DatagramChannel.receive(ByteBuffer) ?
Date Thu, 06 Jul 2006 02:59:09 GMT
Hello everybody,

When I reviewed o.a.h.nio.internal.DatagramChannelImpl, I found following
FIXME:
" // // FIXME donot peek at time,see if can improve
            // DatagramPacket peekPack = new DatagramPacket(new byte[1], 1);
            // synchronized (dataLock) {
            // networkSystem.receiveDatagram(fd, peekPack, peekPack.getData
(),
            // peekPack.getOffset(), peekPack.getLength(),
            // isBlocking() ? 0 : DEFAULT_TIMEOUT, true);
            // }
            // if (null == peekPack.getAddress()) {
            // // if no new packet peeked
            // return null;
            // } "
I feel a little puzzled by this FIXME. After writing several tests, I don't
think peek is necessary.

Could anyone tell me whether peek operation makes any sense here?

Thanks!

Best regards,

-- 
Andrew Zhang
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message