7036157: TCP connection does not use kdc_timeout
authorweijun
Thu, 14 Apr 2011 12:40:30 +0800
changeset 9268 0fee35a7b071
parent 9267 bbad6ad93743
child 9269 f66626469aa8
7036157: TCP connection does not use kdc_timeout Reviewed-by: valeriep
jdk/src/share/classes/sun/security/krb5/internal/NetClient.java
--- a/jdk/src/share/classes/sun/security/krb5/internal/NetClient.java	Wed Apr 13 16:12:49 2011 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/internal/NetClient.java	Thu Apr 14 12:40:30 2011 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,8 @@
 
     TCPClient(String hostname, int port, int timeout)
             throws IOException {
-        tcpSocket = new Socket(hostname, port);
+        tcpSocket = new Socket();
+        tcpSocket.connect(new InetSocketAddress(hostname, port), timeout);
         out = new BufferedOutputStream(tcpSocket.getOutputStream());
         in = new BufferedInputStream(tcpSocket.getInputStream());
         tcpSocket.setSoTimeout(timeout);