jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java
changeset 22992 e7fcc52b1b29
parent 12295 2e08a27dd105
child 23904 4a8ca39187ef
equal deleted inserted replaced
22991:ed73cb1663a5 22992:e7fcc52b1b29
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   409                     udpSocket.setSoTimeout(timeoutLeft);
   409                     udpSocket.setSoTimeout(timeoutLeft);
   410                     long start = System.currentTimeMillis();
   410                     long start = System.currentTimeMillis();
   411                     udpSocket.receive(ipkt);
   411                     udpSocket.receive(ipkt);
   412                     long end = System.currentTimeMillis();
   412                     long end = System.currentTimeMillis();
   413 
   413 
   414                     byte[] data = new byte[ipkt.getLength()];
   414                     byte[] data = ipkt.getData();
   415                     data = ipkt.getData();
       
   416                     if (isMatchResponse(data, xid)) {
   415                     if (isMatchResponse(data, xid)) {
   417                         return data;
   416                         return data;
   418                     }
   417                     }
   419                     timeoutLeft = pktTimeout - ((int) (end - start));
   418                     timeoutLeft = pktTimeout - ((int) (end - start));
   420                 } while (timeoutLeft > minTimeout);
   419                 } while (timeoutLeft > minTimeout);