From f31911f039743cc8121cf02899dbc37456e58a1d Mon Sep 17 00:00:00 2001 From: shadowislord Date: Sat, 31 May 2014 17:36:49 -0400 Subject: [PATCH] * Fix java 8 syntax error in UdpEndpoint --- .../java/com/jme3/network/kernel/udp/UdpEndpoint.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpEndpoint.java b/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpEndpoint.java index f1a97a29f..0c915ff81 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpEndpoint.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpEndpoint.java @@ -38,6 +38,7 @@ import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.SocketAddress; +import java.net.SocketException; import java.nio.ByteBuffer; @@ -127,8 +128,14 @@ public class UdpEndpoint implements Endpoint kernel.enqueueWrite( this, p ); //socket.send(p); - } catch( IOException e ) { - throw new KernelException( "Error sending datagram to:" + address, e ); + } catch (Exception e) { + if (e instanceof SocketException) { + throw new KernelException("Error sending datagram to:" + address, e); + } else if (e instanceof RuntimeException) { + throw (RuntimeException) e; + } else { + throw new RuntimeException(e); + } } }