Code example for FileDescriptor

0
     * for native call 
     */ 
    @SuppressWarnings("unused") 
    private DatagramChannelImpl() { 
        super(SelectorProvider.provider());
        fd = new FileDescriptor();
        connectAddress = new InetSocketAddress(0);
    } 
 
    /* 
     * Getting the internal DatagramSocket If we have not the socket, we create 
     * a new one. 
     */ 
    @Override 
    synchronized public DatagramSocket socket() {
        if (null == socket) {
            socket = new DatagramSocketAdapter(
                    new PlainDatagramSocketImpl(fd, localPort), this);
        } 
        return socket;
    }