From 9d6115d3e947a0804a3df7e4e97b7ea833ca8f0d Mon Sep 17 00:00:00 2001 From: mkoch Date: Thu, 3 Oct 2002 14:30:48 +0000 Subject: 2002-10-03 Michael Koch * java/net/DatagramPacket.java (setLength): Fixed typo and be HTML-aware. * java/net/InetSocketAddress.java (InetSocketAddress): Correct initialization of hostname, fixed typo. (equals): Added comment about equality of InetSocketAddress objects. * java/net/ServerSocket.java (accept): Added checks. (isClosed): New stubbed method. * java/net/SocketOptions.java: Reindention. * java/net/SocketPermission (SocketPermission): Documentation fixed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57776 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/net/ServerSocket.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libjava/java/net/ServerSocket.java') diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java index 36f93e8b64c..b7c69913a05 100644 --- a/libjava/java/net/ServerSocket.java +++ b/libjava/java/net/ServerSocket.java @@ -287,6 +287,13 @@ public class ServerSocket */ public Socket accept () throws IOException { + if (impl == null) + throw new IOException ("Cannot initialize Socket implementation"); + + SecurityManager sm = System.getSecurityManager (); + if (sm != null) + sm.checkListen (impl.getLocalPort ()); + Socket s = new Socket(); implAccept (s); @@ -358,6 +365,17 @@ public class ServerSocket return true; } + /** + * Returns true if the socket is closed, otherwise false + * + * @since 1.4 + */ + public boolean isClosed() + { + // FIXME: implement this + return false; + } + /** * Sets the value of SO_TIMEOUT. A value of 0 implies that SO_TIMEOUT is * disabled (ie, operations never time out). This is the number of -- cgit v1.2.3