Code example for FileDescriptor

0
        this.localPort = localPort;
    } 
 
    public PlainDatagramSocketImpl() { 
        super(); 
        fd = new FileDescriptor();
    } 
 
    @Override 
    public void bind(int port, InetAddress addr) throws SocketException {
        String prop = AccessController.doPrivileged(new PriviAction<String>("bindToDevice")); //$NON-NLS-1$
        boolean useBindToDevice = prop != null && prop.toLowerCase().equals("true"); //$NON-NLS-1$
        netImpl.bind(fd, addr, port);
        if (0 != port) {
            localPort = port;
        } else { 
            localPort = netImpl.getSocketLocalPort(fd);
        } 
 
        try { 
            // Ignore failures