Code example for DatagramSocket

Methods: getPort

0
        if (socket == null)
        { 
            throw new NullPointerException("socket=null");
        } 
        this.socket = socket;
        super.setName(THREAD_NAME + "-" + socket.getPort());
        listening = false;
    } 
     
    /** 
     * Returns the listening UDP socket. 
     *  
     * @return the listening UDP socket. 
     */ 
    protected DatagramSocket getSocket()
    { 
        return socket;
    } 
     
    /** 
     * Indicates if the listener is listening!