public void send( ByteBuffer data ) { if( !isConnected() ) { throw new KernelException( "Endpoint is not connected:" + this ); } try { DatagramPacket p = new DatagramPacket( data.array(), data.position(), data.remaining(), address ); // Just queue it up for the kernel threads to write // out kernel.enqueueWrite( this, p ); //socket.send(p); } 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); } } }
public void send( ByteBuffer data ) { if( !isConnected() ) { throw new KernelException( "Endpoint is not connected:" + this ); } try { DatagramPacket p = new DatagramPacket( data.array(), data.position(), data.remaining(), address ); // Just queue it up for the kernel threads to write // out kernel.enqueueWrite( this, p ); //socket.send(p); } catch( IOException e ) { throw new KernelException( "Error sending datagram to:" + address, e ); } }
public void send( ByteBuffer data ) { if( !isConnected() ) { throw new KernelException( "Endpoint is not connected:" + this ); } try { DatagramPacket p = new DatagramPacket( data.array(), data.position(), data.remaining(), address ); // Just queue it up for the kernel threads to write // out kernel.enqueueWrite( this, p ); //socket.send(p); } 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); } } }