diff options
author | Michael Koch <konqueror@gmx.de> | 2003-06-18 08:56:55 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-06-18 08:56:55 +0000 |
commit | 299f5809e2d4bafeacb8d05d89da423f0e179a28 (patch) | |
tree | c6a667deaaa6cb0a24b5ccb00dcb11b2cccab60e /libjava/gnu/java/nio/natSocketChannelImpl.cc | |
parent | 20d513ff665af54cc8fb5cac4d2f4fe86ea94259 (diff) | |
download | gcc-299f5809e2d4bafeacb8d05d89da423f0e179a28.zip gcc-299f5809e2d4bafeacb8d05d89da423f0e179a28.tar.gz gcc-299f5809e2d4bafeacb8d05d89da423f0e179a28.tar.bz2 |
2003-06-18 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/SelectorImpl.java
(register): Use fd with value 0 for now, will be fixed later.
* gnu/java/nio/ServerSocketChannelImpl.java
(fd): Removed.
(local_port): Removed.
(InetSocketAddress): Removed.
(ServerSocketChannelImpl): Just initialize internal socket object.
(implCloseSelectableChannel): Close internal socket object.
(implConfigureBlocking): Added comment.
(accept): Use jaba.net stuff to accept socket.
* gnu/java/nio/SocketChannelImpl.java
(fd): Removed.
(local_port): Removed.
(InetSocketAddress): Removed.
(SocketCreate): Removed.
(SocketConnect): Removed.
(SocketBind): Removed.
(SocketListen): Removed.
(SocketAvailable): Removed.
(SocketClose): Removed.
(SocketRead): Removed.
(SocketWrite): Removed.
(SocketChannelImpl): Just initialize internal socket object.
(implCloseSelectableChannel): Close internal socket object.
(implConfigureBlocking): Fixed implementation, added comment.
(connect): Use internal socket object to connect.
(socket): No need for sanity checks.
(read): Comment out some stuff, this will be reimplemented in the next
commit.
(write): Likewise.
* gnu/java/nio/natFileChannelImpl.cc
(nio_mmap_file): Line wrapped.
* gnu/java/nio/natSocketChannelImpl.cc: Removed.
* Makefile.am
(nat_source_files): Removeded gnu/java/nio/natSocketChannelImpl.cc.
* Makefile.in: Regenerated.
From-SVN: r68145
Diffstat (limited to 'libjava/gnu/java/nio/natSocketChannelImpl.cc')
-rw-r--r-- | libjava/gnu/java/nio/natSocketChannelImpl.cc | 172 |
1 files changed, 0 insertions, 172 deletions
diff --git a/libjava/gnu/java/nio/natSocketChannelImpl.cc b/libjava/gnu/java/nio/natSocketChannelImpl.cc deleted file mode 100644 index 480cc94..0000000 --- a/libjava/gnu/java/nio/natSocketChannelImpl.cc +++ /dev/null @@ -1,172 +0,0 @@ -// natSocketChannelImpl.cc - -/* Copyright (C) 2002, 2003 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 <gcj/cni.h> -#include <gnu/java/nio/SocketChannelImpl.h> -#include <java/io/IOException.h> -#include <java/net/InetAddress.h> -#include <java/net/SocketException.h> - - -#ifdef DISABLE_JAVA_NET - -jint -gnu::java::nio::SocketChannelImpl::SocketCreate () -{ - throw new ::java::io::IOException (JvNewStringUTF ("SocketCreate not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketConnect (jint, - ::java::net::InetAddress *, - jint) -{ - throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketBind (jint, ::java::net::InetAddress *, - jint) -{ - throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketListen (jint, jint) -{ - throw new ::java::io::IOException (JvNewStringUTF ("SocketList not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketAvailable (jint) -{ - throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketAvailable: not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketClose (jint) -{ - throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketClose: not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketRead (jint, jbyteArray, jint, jint) -{ - throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketRead: not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketWrite (jint, jbyteArray, jint, jint) -{ - throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketWrite: not implemented")); -} - -#else // DISABLE_JAVA_NET - -jint -gnu::java::nio::SocketChannelImpl::SocketCreate () -{ - int sock = _Jv_socket (AF_INET, SOCK_STREAM, 0); - - if (sock < 0) - { - char* strerr = strerror (errno); - throw new ::java::io::IOException (JvNewStringUTF (strerr)); - } - - return sock; -} - -jint -gnu::java::nio::SocketChannelImpl::SocketConnect (jint fd, - ::java::net::InetAddress *addr, - jint port) -{ - throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketBind (jint fd, - ::java::net::InetAddress *addr, - jint port) -{ - throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketListen (jint fd, jint backlog) -{ - int result = _Jv_listen (fd, backlog); - - if (result < 0) - { - char* strerr = strerror (errno); - throw new ::java::io::IOException (JvNewStringUTF (strerr)); - } - - return result; -} - -jint -gnu::java::nio::SocketChannelImpl::SocketAvailable (jint /*fd*/) -{ - throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketAvailable: not implemented")); -} - -jint -gnu::java::nio::SocketChannelImpl::SocketClose (jint fd) -{ - int result = _Jv_close (fd); - - if (result < 0) - { - char* strerr = strerror (errno); - throw new ::java::io::IOException (JvNewStringUTF (strerr)); - } - - return result; -} - -jint -gnu::java::nio::SocketChannelImpl::SocketRead (jint fd, jbyteArray data, - jint offset, jint length) -{ - int result = ::recv (fd, data, offset, length); - - if (result < 0) - { - char* strerr = strerror (errno); - throw new ::java::io::IOException (JvNewStringUTF (strerr)); - } - - return result; -} - -jint -gnu::java::nio::SocketChannelImpl::SocketWrite (jint fd, jbyteArray data, - jint offset, jint length) -{ - int result = ::send (fd, data, offset, length); - - if (result < 0) - { - char* strerr = strerror (errno); - throw new ::java::io::IOException (JvNewStringUTF (strerr)); - } - - return result; -} - -#endif // DISABLE_JAVA_NET |