Commit Graph

37 Commits

Author SHA1 Message Date
3a67f81b50 Add the FileChannel class
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-10-21 10:59:59 -05:00
87b02eb949 update copyright years
Previously, I used a shell script to extract modification date ranges
from the Git history, but that was complicated and unreliable, so now
every file just gets the same year range in its copyright header.  If
someone needs to know when a specific file was modified and by whom,
they can look at the Git history themselves; no need to include it
redundantly in the header.
2013-07-02 20:52:38 -06:00
JET
b66d8b9fbf Expanded DatagramChannel and corrected blocking configuration in connect(). 2013-07-02 10:10:05 -06:00
9974d91648 implement DatagramChannel.receive and fix Datagrams to be Java 6 compatible 2012-07-10 14:09:14 -06:00
c602f4673b implement java.nio.channels.DatagramChannel 2012-07-03 11:24:05 -06:00
0addd8c814 update copyright years 2012-05-11 17:43:27 -06:00
b45528203d avoid crashes due to calling select or wakeup on a closed Selector 2012-01-31 09:48:05 -07:00
807f2a8d51 avoid crash when Selector.close is called more than once on the same instance 2012-01-30 13:42:32 -07:00
0c253c40a2 add ServerSocketChannel.handleReadyOps to fix build 2011-01-13 07:03:28 -07:00
39018c20e0 check connection readyness in SocketChannel.finishConnect if necessary 2011-01-11 18:39:48 -07:00
eb3a9f010b fix false positive return from SocketChannel.finishConnect
This fixes a bug in finishConnect such that it would return true even
if the socket had not yet connected successfully.
2011-01-11 18:29:48 -07:00
4f0dccb53c add Channels.newChannel methods 2011-01-11 18:26:37 -07:00
a5742f5985 update copyright years 2010-12-05 20:21:09 -07:00
b3accf1b30 ServerSocketChannel throws IOException, not Exception 2010-10-13 13:38:31 -06:00
b3da635b63 add java.nio.channels.Channels implementation 2010-07-13 18:03:25 -06:00
47d9039b69 switch from gethostbyname to getaddrinfo on POSIX systems
gethostbyname may return any combination of IPv4 and IPv6 addresses,
and it's not safe to assume the first address is IPv4, which is all
our code is currently prepared to handle.  In contrast, getaddrinfo
allows us to specify whether we want IPv4, IPv6, or both.

We should eventually make this switch on Windows as well, but the
status of getaddrinfo in Windows 2000 is not clear, and MinGW's
ws2tcpip.h only declares it for XP and above.

This commit also adds InetAddress.getByName for explicit DNS lookups.
2010-06-14 16:09:56 -06:00
b908f575d5 fix several blocking SocketChannel bugs
In java-nio.cpp, we can't use GetPrimitiveArrayCritical when reading
from or writing to blocking sockets since it may block the rest of the
VM indefinitely.

In SelectableChannel.java, we can't use a null test on
SelectableChannel.key to determine whether the channel is open since
it might never be registered with a Selector.  According to the Sun
documentation, a SelectableChannel is open as soon as it's created, so
that's what we now implement.
2010-06-04 15:37:22 -06:00
6118792ffd update copyright years 2009-12-02 19:08:29 -07:00
3862128a3a tolerate EINTR in ServerSocketChannel.accept implementation
On POSIX systems, Avian sends a special signal to a thread to
implement Thread.getStackTrace() when called from a different thread.
If the target thread is blocked on a call to accept when this happens,
it will return -1, with errno set to EINTR.  Instead of treating this
as an error, we now just loop and call accept again.
2009-11-16 17:23:09 -07:00
ef00ff80ef avoid EAGAIN or EWOULDBLOCK errors due to SocketSelector.wakup being called many times between calls to select 2009-10-30 08:55:55 -06:00
efdfb796d9 implement SocketChannel.isConnected 2009-10-29 16:19:33 -06:00
59ba4aecf2 implement non-blocking socket connections 2009-10-08 16:26:20 -06:00
fb40b046fd fix regression in SocketSelector when selecting ServerSocketChannels 2009-09-28 16:54:49 -06:00
80d4385cb8 implement blocking mode for SocketChannel and ServerSocketChannel 2009-08-03 08:58:56 -06:00
29858a5299 implement Selector.selectNow() and select() 2009-07-23 13:08:41 -06:00
d1018bf078 update copyright years 2009-03-15 12:02:36 -06:00
8659c709b7 avoid passing null arguments to native methods in SocketChannel 2009-03-02 15:22:17 -07:00
fccf906349 add minimal java.net.Socket implementation to support Socket.setTcpNoDelay 2008-11-22 15:32:53 -07:00
6cddd10e0a various code cleanups, bug fixes, and compatibility fixes in NIO code 2008-03-25 16:17:29 -06:00
3a208edbbc update NIO code to be more compatible with Java 2008-03-25 11:18:17 -06:00
2edaa82801 prepend copyright notice and license to all source files; add license.txt and readme.txt 2008-02-19 11:06:52 -07:00
4b92017ea9 fix several win32 bugs in SocketSelector 2007-10-26 18:04:55 -06:00
00cfa587bc Various bug fixes and optimizations 2007-10-11 15:41:23 -06:00
9368dd2acc Fix another off-by-one error when EOS is hit on the socket 2007-10-07 11:35:48 -06:00
35a96a0d36 Fix an off-by-one error when EOS is hit on the socket 2007-10-07 09:53:07 -06:00
19b6e11cbc Make sure to report EOF when reading from a socket channel 2007-10-05 15:51:06 -06:00
98269286e5 Implemented a basic NIO socket channel interface. Non-blocking socket channels
and server socket channels are implemented.  This version works but only when
libnative is linked with g++ (because of C++ object creation code that fails
without this linking)
2007-10-05 15:32:56 -06:00