changeset 9268:0fee35a7b071

7036157: TCP connection does not use kdc_timeout Reviewed-by: valeriep
author weijun
date Thu, 14 Apr 2011 12:40:30 +0800
parents bbad6ad93743
children f66626469aa8
files jdk/src/share/classes/sun/security/krb5/internal/NetClient.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);