This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[PATCH] gnu.java.nio - ServerSocketImpl
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Fri, 14 Feb 2003 13:05:36 +0100
- Subject: [PATCH] gnu.java.nio - ServerSocketImpl
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi List,
I commited the appended patch to gnu.java.nio.ServerSocketImpl.
Michael.
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+TNuQWSOgCCdjSDsRAtHDAKCdyNFHA5rrzNTHNGKchzzKnGhlqACeMAkQ
QQCg6zyLusJAbw27CndBvn0=
=ggn6
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1698
diff -u -r1.1698 ChangeLog
--- ChangeLog 13 Feb 2003 19:28:31 -0000 1.1698
+++ ChangeLog 14 Feb 2003 12:03:48 -0000
@@ -1,3 +1,10 @@
+2003-02-14 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/natServerSocketChannelImpl.cc: Removed.
+ * gnu/java/nio/ServerSocketChannelImpl.java
+ (SocketAccept): Removed.
+ (accept): Commented out use of SocketAccept.
+
2003-02-13 Michael Koch <konqueror@gmx.de>
* java/awt/Label.java
Index: gnu/java/nio/natServerSocketChannelImpl.cc
===================================================================
RCS file: gnu/java/nio/natServerSocketChannelImpl.cc
diff -N gnu/java/nio/natServerSocketChannelImpl.cc
--- gnu/java/nio/natServerSocketChannelImpl.cc 29 Nov 2002 07:56:58 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,77 +0,0 @@
-// natSelectorImpl.cc
-
-/* Copyright (C) 2002 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-#include <config.h>
-#include <platform.h>
-
-#include <errno.h>
-#include <netinet/in.h>
-
-#include <gcj/cni.h>
-#include <gnu/java/nio/ServerSocketChannelImpl.h>
-#include <gnu/java/nio/SocketChannelImpl.h>
-#include <java/io/IOException.h>
-#include <java/net/InetSocketAddress.h>
-#include <java/net/SocketException.h>
-
-union SockAddr
-{
- struct sockaddr_in address;
-#ifdef HAVE_INET6
- struct sockaddr_in6 address6;
-#endif
-};
-
-jint
-gnu::java::nio::ServerSocketChannelImpl::SocketAccept (
- ServerSocketChannelImpl* socket,
- SocketChannelImpl* s)
-{
- union SockAddr u;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- socklen_t addrlen = sizeof(struct sockaddr);
-/*
- jbyteArray haddress = socket->sa->getAddress ()->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
-
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
- memcpy (&u.address.sin_addr, bytes, len);
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons ( socket->sa->getPort ());
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (socket->sa->getPort ());
- }
-#endif
- else
- throw new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
-*/
-
- int sock = _Jv_accept (socket->fd, ptr, &addrlen);
-
- // FIXME: write address/port in ptr into java variables
-
- if (sock < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- s->fd = sock;
- return sock;
-}
Index: gnu/java/nio/ServerSocketChannelImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/ServerSocketChannelImpl.java,v
retrieving revision 1.3
diff -u -r1.3 ServerSocketChannelImpl.java
--- gnu/java/nio/ServerSocketChannelImpl.java 11 Feb 2003 09:44:57 -0000 1.3
+++ gnu/java/nio/ServerSocketChannelImpl.java 14 Feb 2003 12:03:48 -0000
@@ -54,9 +54,6 @@
boolean connected = false;
// InetSocketAddress sa;
- private static native int SocketAccept (ServerSocketChannelImpl server,
- SocketChannelImpl s);
-
protected ServerSocketChannelImpl (SelectorProvider provider)
throws IOException
{
@@ -103,7 +100,7 @@
{
SocketChannelImpl result = new SocketChannelImpl (provider ());
result.sa = new InetSocketAddress (0);
- int res = SocketAccept (this,result);
+ //int res = SocketAccept (this,result);
return result;
}