Revision: 3322
http://jnode.svn.sourceforge.net/jnode/?rev=3322&view=rev
Author: lsantha
Date: 2007-06-25 12:47:44 -0700 (Mon, 25 Jun 2007)
Log Message:
-----------
Openjdk integration.
Modified Paths:
--------------
trunk/core/src/classpath/java/java/net/URLConnection.java
Modified: trunk/core/src/classpath/java/java/net/URLConnection.java
===================================================================
--- trunk/core/src/classpath/java/java/net/URLConnection.java 2007-06-25 19:45:25 UTC (rev 3321)
+++ trunk/core/src/classpath/java/java/net/URLConnection.java 2007-06-25 19:47:44 UTC (rev 3322)
@@ -177,6 +177,12 @@
* The timeout period.
*/
private int timeout;
+
+ //jnode openjdk
+ /**
+ * The read timeout period.
+ */
+ private int readTimeout;
/* Cached ParsePosition, used when parsing dates. */
private ParsePosition position;
@@ -1103,4 +1109,43 @@
dateFormats[2] = new SimpleDateFormat("EEE MMM d hh:mm:ss yyyy", locale);
dateformats_initialized = true;
}
+
+ //jnode openjdk
+ /**
+ * Returns the read timeout, in milliseconds, or zero if the timeout
+ * is infinite or not set.
+ *
+ * @return The timeout.
+ *
+ * @see #setReadTimeout
+ *
+ * @since 1.5
+ */
+ public int getReadTimeout()
+ {
+ return readTimeout;
+ }
+
+ /**
+ * Set the read timeout, in milliseconds, or zero if the timeout
+ * is to be considered infinite. Note that in certain socket
+ * implementations/platforms this method may not have any effect.
+ *
+ * Throws an <code>IllegalArgumentException</code> if timeout < 0.
+ *
+ * @param timeout - The timeout, in milliseconds.
+ *
+ * @throws IllegalArgumentException if timeout is negative.
+ *
+ * @see #getReadTimeout
+ *
+ * @since 1.5
+ */
+ public void setReadTimeout(int timeout)
+ throws IllegalArgumentException
+ {
+ if( timeout < 0 )
+ throw new IllegalArgumentException("Timeout must be 0 or positive.");
+ readTimeout = timeout;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|