summaryrefslogtreecommitdiff
path: root/gnu/java/nio/SocketChannelImpl.java
diff options
context:
space:
mode:
authorRonald Veldema <rveldema@cs.vu.nl>2002-04-08 10:14:49 +0000
committerRonald Veldema <rveldema@cs.vu.nl>2002-04-08 10:14:49 +0000
commit1f38683012be387218081bf51cda77aac708058d (patch)
tree96bee8cf5c70d306f244a99dcd705b4dd5754fe6 /gnu/java/nio/SocketChannelImpl.java
parentd5bc926813c38e6dac3d39f3fb1c7cee67760125 (diff)
downloadclasspath-1f38683012be387218081bf51cda77aac708058d.tar.gz
- basic nio apps now work
- removed old Accessible, now use new javax.Accessibility
Diffstat (limited to 'gnu/java/nio/SocketChannelImpl.java')
-rw-r--r--gnu/java/nio/SocketChannelImpl.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/gnu/java/nio/SocketChannelImpl.java b/gnu/java/nio/SocketChannelImpl.java
index 8fd5f47e5..1f38b5920 100644
--- a/gnu/java/nio/SocketChannelImpl.java
+++ b/gnu/java/nio/SocketChannelImpl.java
@@ -5,6 +5,7 @@ import java.io.*;
import java.nio.*;
import java.nio.channels.*;
import java.nio.channels.spi.*;
+import gnu.classpath.Configuration;
public class SocketChannelImpl extends SocketChannel
{
@@ -14,7 +15,7 @@ public class SocketChannelImpl extends SocketChannel
boolean blocking = true;
boolean connected = false;
InetSocketAddress sa;
-
+
static native int SocketCreate();
static native int SocketConnect(int fd, InetAddress a, int port);
static native int SocketBind(int fd, InetAddress host, int port);
@@ -29,6 +30,11 @@ public class SocketChannelImpl extends SocketChannel
super(provider);
fd = SocketCreate();
+
+ if (fd == -1)
+ {
+ System.err.println("failed to create socket:"+fd);
+ }
//System.out.println("socket-channel:"+fd);
}
@@ -162,7 +168,7 @@ public class SocketChannelImpl extends SocketChannel
if (src instanceof ByteBufferImpl)
{
ByteBufferImpl bi = (ByteBufferImpl) src;
- byte[]b = bi.backing_buffer;
+ byte[]b = bi.array();
bytes = SocketWrite(fd, b, 0, len);
//System.out.println("reused memory buffer....");