Code example for SocketException

0
            return flags;
        } 
        if (ERRORCODE_SOCKET_TIMEOUT == result) {
            return new int[0]; 
        } 
        throw new SocketException();
 
    } 
 
    public InetAddress getSocketLocalAddress(FileDescriptor aFD,
            boolean preferIPv6Addresses) {
        return getSocketLocalAddressImpl(aFD, preferIPv6Addresses);
    } 
 
    /* 
     * Query the IP stack for the local port to which this socket is bound. 
     *  
     * @param aFD the socket descriptor @param preferIPv6Addresses address 
     * preference for nodes that support both IPv4 and IPv6 @return int the 
     * local port to which the socket is bound 
     */