Code example for FileDescriptor

0
        this.localPort = localPort;
    } 
 
    public PlainDatagramSocketImpl() { 
        super(); 
        fd = new FileDescriptor();
    } 
 
    @Override 
    public void bind(int port, InetAddress addr) throws SocketException {
        netImpl.bind(fd, addr, port);
        if (0 != port) {
            localPort = port;
        } else { 
            localPort = netImpl.getSocketLocalPort(fd);
        } 
 
        try { 
            // Ignore failures 
            setOption(SO_BROADCAST, Boolean.TRUE);
        } catch (IOException e) {