@SuppressWarnings ( {
        "unused", "resource"
    } )
    @Test
    public void testDgramSocket () throws Exception {

        ServerThread serverThread = new ServerThread() {

            @Override
            protected void handleConnection ( final AFUNIXSocket sock ) throws IOException {
                System.err.println("Server running");
                InputStream is = sock.getInputStream();
                OutputStream os = sock.getOutputStream();
                assertEquals(1, is.read());
                assertEquals(2, is.read());
                assertEquals(3, is.read());
                assertEquals(4, is.read());
                System.err.println("Read on server");
            }
        };

        try ( AFUNIXSocket sock = connectToServer() ) {
            System.err.println("Client running");
            InputStream is = sock.getInputStream();
            OutputStream os = sock.getOutputStream();
            os.write(1);
            os.write(2);
            os.write(3);
            os.write(4);
            System.err.println("Wrote from client");
        }
        catch ( Exception e ) {
            e.printStackTrace();
        }

        serverThread.checkException();
    }