diff options
author | Warren Levy <warrenl@gcc.gnu.org> | 1999-05-26 17:00:06 +0000 |
---|---|---|
committer | Warren Levy <warrenl@gcc.gnu.org> | 1999-05-26 17:00:06 +0000 |
commit | f2ed9e9656a375cf80b11dfb3a264a7551654ecd (patch) | |
tree | a946b25d980c088ac8a79fbfeefceff665041269 /libjava/java/net/ServerSocket.java | |
parent | de4abb91d1a9f13baceb3e50f73829c0f21b830c (diff) | |
download | gcc-f2ed9e9656a375cf80b11dfb3a264a7551654ecd.zip gcc-f2ed9e9656a375cf80b11dfb3a264a7551654ecd.tar.gz gcc-f2ed9e9656a375cf80b11dfb3a264a7551654ecd.tar.bz2 |
[multiple changes]
1999-05-26 Bryce McKinlay <bryce@albatross.co.nz>
* java/net/DatagramSocket.java (getSoTimeout): Verify class type.
* java/net/DatagramSocketImpl.java (getOption): Made abstract.
(setOption): Made abstract.
* java/net/PlainDatagramSocketImpl.java: Mirror SocketOptions fields
to avoid cpp conflicts in native code.
* java/net/PlainSocketImpl.java: Mirror SocketOptions fields to avoid
cpp conflicts in native code.
* java/net/ServerSocket.java (toString): Prepended "ServerSocket".
* java/net/Socket.java (getLocalAddress): Implemented.
(setTcpNoDelay): Implemented.
(getTcpNoDelay): Implemented.
(setSoLinger): Implemented.
(getSoLinger): Implemented.
(getSoTimeout): Verify class type.
(setSendBufferSize): Implemented.
(getSendBufferSize): Implemented.
(setReceiveBufferSize): Implemented.
(getReceiveBufferSize): Implemented.
(toString): Prepended "Socket".
* java/net/SocketImpl.java (toString): Rewritten.
(getOption): Made abstract.
(setOption): Made abstract.
* java/net/natPlainSocketImpl.cc (connect): Set localport properly.
(setOption): Implemented.
(getOption): Implemented.
1999-05-26 Warren Levy <warrenl@cygnus.com>
* java/net/DatagramSocket.java (DatagramSocket): Get local host
address when null. Set SO_REUSEADDR for multicasts.
(getSoTimeout): Implemented.
(setSoTimeout): Implemented.
* java/net/DatagramSocketImpl.java: Implement SocketOptions interface.
* java/net/MulticastSocket.java (getInterface): Implemented.
(setInterface): Implemented.
(setTimeToLive): Check for invalid ttl.
(joinGroup): Verify multicast address and security.
(leaveGroup): Verify multicast address and security.
(send): Implemented.
* java/net/PlainDatagramSocketImpl.java (timeout): Added.
(iface): Added.
(ttl): Added.
(setOption): Added.
(getOption): Added.
(mcastGrp): Added.
(getTTL): Implemented as non-native.
(setTTL): ditto.
(join): ditto.
(leave): ditto.
* java/net/ServerSocket.java (setSoTimeout): Implemented.
(getSoTimeout): Implemented.
(setSocketFactory): Made synchronized.
* java/net/Socket.java (setSoTimeout): Implemented.
(getSoTimeout): Implemented.
(close): Made synchronized.
(setSocketImplFactory): Made synchronized.
* java/net/SocketImpl.java: Implement SocketOptions interface.
* java/net/natInetAddress.cc: Corrected module name at top of file.
* java/net/natPlainDatagramSocketImpl.cc (McastReq): Added union.
(bind): Added FIXME.
(peek): Implemented.
(setTTL): Removed.
(getTTL): Removed.
(join): Removed.
(leave): Removed.
(mcastGrp): Added.
(setOption): Implemented for SO_REUSEADDR.
(getOption): Implemented for SO_REUSEADDR.
From-SVN: r27184
Diffstat (limited to 'libjava/java/net/ServerSocket.java')
-rw-r--r-- | libjava/java/net/ServerSocket.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java index 4dcd9d6..ae1e113 100644 --- a/libjava/java/net/ServerSocket.java +++ b/libjava/java/net/ServerSocket.java @@ -1,4 +1,4 @@ -// Socket.java +// ServerSocket.java /* Copyright (C) 1999 Cygnus Solutions @@ -14,8 +14,7 @@ details. */ */ /** Written using on-line Java Platform 1.2 API Specification. - * Status: I believe all methods are implemented, but many - * of them just throw an exception. + * Status: I believe all methods are implemented. */ package java.net; @@ -81,25 +80,31 @@ public class ServerSocket impl.close(); } - public void setSoTimeout (int timeout) throws SocketException + public synchronized void setSoTimeout (int timeout) throws SocketException { - throw new InternalError("ServerSocket.setSoTimeout not implemented"); + if (timeout < 0) + throw new IllegalArgumentException("Invalid timeout: " + timeout); + + impl.setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout)); } - public int getSoTimeout () throws SocketException + public synchronized int getSoTimeout () throws SocketException { - throw new InternalError("ServerSocket.getSoTimeout not implemented"); + Object timeout = impl.getOption(SocketOptions.SO_TIMEOUT); + if (timeout instanceof Integer) + return ((Integer)timeout).intValue(); + else + return 0; } public String toString () { - return impl.toString(); + return "ServerSocket" + impl.toString(); } - public static void setSocketFactory (SocketImplFactory fac) + public static synchronized void setSocketFactory (SocketImplFactory fac) throws IOException { factory = fac; } - } |