equal
deleted
inserted
replaced
738 cachedSenderInetAddress = isa.getAddress(); |
738 cachedSenderInetAddress = isa.getAddress(); |
739 cachedSenderPort = isa.getPort(); |
739 cachedSenderPort = isa.getPort(); |
740 |
740 |
741 // set or refresh local address |
741 // set or refresh local address |
742 localAddress = Net.localAddress(fd); |
742 localAddress = Net.localAddress(fd); |
|
743 |
|
744 // flush any packets already received. |
|
745 boolean blocking = false; |
|
746 synchronized (blockingLock()) { |
|
747 try { |
|
748 blocking = isBlocking(); |
|
749 ByteBuffer tmpBuf = ByteBuffer.allocate(100); |
|
750 if (blocking) { |
|
751 configureBlocking(false); |
|
752 } |
|
753 do { |
|
754 tmpBuf.clear(); |
|
755 } while (read(tmpBuf) > 0); |
|
756 } finally { |
|
757 if (blocking) { |
|
758 configureBlocking(true); |
|
759 } |
|
760 } |
|
761 } |
743 } |
762 } |
744 } |
763 } |
745 } |
764 } |
746 return this; |
765 return this; |
747 } |
766 } |