Search in sources :

Example 6 with NioException

use of org.webpieces.nio.api.exceptions.NioException in project webpieces by deanhiller.

the class DatagramChannelImpl method bind.

/**
     * @see org.webpieces.nio.api.channels.RegisterableChannel#bind(java.net.SocketAddress)
     */
public void bind(SocketAddress addr) {
    try {
        socket = new DatagramSocket(addr);
        readerThread = new ReaderThread();
        readerThread.start();
    } catch (IOException e) {
        throw new NioException(e);
    }
}
Also used : DatagramSocket(java.net.DatagramSocket) IOException(java.io.IOException) NioException(org.webpieces.nio.api.exceptions.NioException)

Aggregations

IOException (java.io.IOException)6 NioException (org.webpieces.nio.api.exceptions.NioException)6 DatagramSocket (java.net.DatagramSocket)1 PortUnreachableException (java.net.PortUnreachableException)1 ByteBuffer (java.nio.ByteBuffer)1 NotYetConnectedException (java.nio.channels.NotYetConnectedException)1 ExecutionException (java.util.concurrent.ExecutionException)1 DataListener (org.webpieces.nio.api.handlers.DataListener)1