+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.
#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>
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 =
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 =
// 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.
}
{
::java::io::InterruptedIOException *iioe =
new ::java::io::InterruptedIOException
- (JvNewStringUTF("read interrupted"));
+ (JvNewStringUTF("Read interrupted"));
iioe->bytesTransferred = r == -1 ? 0 : r;
throw iioe;
}
{
::java::net::SocketTimeoutException *timeoutException =
new ::java::net::SocketTimeoutException
- (JvNewStringUTF ("read timed out"));
+ (JvNewStringUTF ("Read timed out"));
throw timeoutException;
}
}
{
::java::io::InterruptedIOException *iioe =
new ::java::io::InterruptedIOException
- (JvNewStringUTF ("read interrupted"));
+ (JvNewStringUTF ("Read interrupted"));
iioe->bytesTransferred = r == -1 ? 0 : r;
throw iioe;
}