Commit 027e655b by Mohan Embar Committed by Mohan Embar

* gnu/java/net/natPlainDatagramSocketImplPosix.cc

	(peekData): Throw SocketTimeoutException instead of
	InterruptedIOException on timeout.
	(receive): Likewise.
	* gnu/java/net/natPlainSocketImplPosix.cc
	(read): Made a minor exception text case change.

From-SVN: r74714
parent 93cbdb1a
2003-12-16 Mohan Embar <gnustuff@thisiscool.com>
* gnu/java/net/natPlainDatagramSocketImplPosix.cc
(peekData): Throw SocketTimeoutException instead of
InterruptedIOException on timeout.
(receive): Likewise.
* gnu/java/net/natPlainSocketImplPosix.cc
(read): Made a minor exception text case change.
2003-12-16 Michael Koch <konqueror@gmx.de>
Fix for PR libgcj/13056.
......
......@@ -29,6 +29,7 @@ details. */
#include <java/io/InterruptedIOException.h>
#include <java/net/BindException.h>
#include <java/net/SocketException.h>
#include <java/net/SocketTimeoutException.h>
#include <java/net/InetAddress.h>
#include <java/net/NetworkInterface.h>
#include <java/net/DatagramPacket.h>
......@@ -225,7 +226,8 @@ gnu::java::net::PlainDatagramSocketImpl::peekData (::java::net::DatagramPacket *
if ((retval = _Jv_select (native_fd + 1, &rset, NULL, NULL, &tv)) < 0)
goto error;
else if (retval == 0)
throw new ::java::io::InterruptedIOException ();
throw new ::java::net::SocketTimeoutException
(JvNewStringUTF ("PeekData timed out") );
}
retlen =
......@@ -345,7 +347,8 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
if ((retval = _Jv_select (native_fd + 1, &rset, NULL, NULL, &tv)) < 0)
goto error;
else if (retval == 0)
throw new ::java::io::InterruptedIOException ();
throw new ::java::net::SocketTimeoutException
(JvNewStringUTF ("Receive timed out") );
}
retlen =
......
......@@ -408,7 +408,7 @@ gnu::java::net::PlainSocketImpl$SocketInputStream::read(void)
// that means we've timed out.
if (sel_retval == 0)
throw new ::java::net::SocketTimeoutException
(JvNewStringUTF ("read timed out") );
(JvNewStringUTF ("Read timed out") );
// If select returns ok we know we either got signalled or read some data...
// either way we need to try to read.
}
......@@ -422,7 +422,7 @@ gnu::java::net::PlainSocketImpl$SocketInputStream::read(void)
{
::java::io::InterruptedIOException *iioe =
new ::java::io::InterruptedIOException
(JvNewStringUTF("read interrupted"));
(JvNewStringUTF("Read interrupted"));
iioe->bytesTransferred = r == -1 ? 0 : r;
throw iioe;
}
......@@ -478,7 +478,7 @@ gnu::java::net::PlainSocketImpl$SocketInputStream::read(jbyteArray buffer, jint
{
::java::net::SocketTimeoutException *timeoutException =
new ::java::net::SocketTimeoutException
(JvNewStringUTF ("read timed out"));
(JvNewStringUTF ("Read timed out"));
throw timeoutException;
}
}
......@@ -493,7 +493,7 @@ gnu::java::net::PlainSocketImpl$SocketInputStream::read(jbyteArray buffer, jint
{
::java::io::InterruptedIOException *iioe =
new ::java::io::InterruptedIOException
(JvNewStringUTF ("read interrupted"));
(JvNewStringUTF ("Read interrupted"));
iioe->bytesTransferred = r == -1 ? 0 : r;
throw iioe;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment