equal
deleted
inserted
replaced
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); |