src/main/java/org/tinyradius/util/RadiusServer.java
protected RadiusPacket handlePacket(InetSocketAddress localAddress, InetSocketAddress remoteAddress, RadiusPacket request, String sharedSecret)
        throws RadiusException, IOException {
        RadiusPacket response = null;

        // check for duplicates
        if (!isPacketDuplicate(request, remoteAddress)) {
            if (localAddress.getPort() == getAuthPort()) {
                // handle packets on auth port
                if (request instanceof AccessRequest) {
                    response = accessRequestReceived((AccessRequest) request, remoteAddress);
                }
                else {
                    logger.error("unknown Radius packet type: " + request.getPacketType());
                }
            }
            else if (localAddress.getPort() == getAcctPort()) {
                // handle packets on acct port
                if (request instanceof AccountingRequest) {
                    response = accountingRequestReceived((AccountingRequest) request, remoteAddress);
                }
                else {
                    logger.error("unknown Radius packet type: " + request.getPacketType());
                }
            }
            else {
                // ignore packet on unknown port
            }
        }
        else {
            logger.info("ignore duplicate packet");
        }

        return response;
    }
/**
     * Handles the received Radius packet and constructs a response.
     *
     * @param localAddress  local address the packet was received on
     * @param remoteAddress remote address the packet was sent by
     * @param request       the packet
     * @return response packet or null for no response
     * @throws RadiusException
     */
Handles the received Radius packet and constructs a response.


Handles the received Radius packet and constructs a response .
protected RadiusPacket handlePacket(InetSocketAddress localAddress, InetSocketAddress remoteAddress, RadiusPacket request, String sharedSecret)
        throws RadiusException, IOException {
        RadiusPacket response = null;
        if (!isPacketDuplicate(request, remoteAddress)) {
            if (localAddress.getPort() == getAuthPort()) {
                if (request instanceof AccessRequest) {
                    response = accessRequestReceived((AccessRequest) request, remoteAddress);
                }
                else {
                    logger.error("unknown Radius packet type: " + request.getPacketType());
                }
            }
            else if (localAddress.getPort() == getAcctPort()) {
                if (request instanceof AccountingRequest) {
                    response = accountingRequestReceived((AccountingRequest) request, remoteAddress);
                }
                else {
                    logger.error("unknown Radius packet type: " + request.getPacketType());
                }
            }
            else {
            }
        }
        else {
            logger.info("ignore duplicate packet");
        }
        return response;
    }
protected RadiusPacket handlePacket ( InetSocketAddress localAddress , InetSocketAddress remoteAddress , RadiusPacket request , String sharedSecret ) throws RadiusException , IOException { RadiusPacket response = null ; if ( ! isPacketDuplicate ( request , remoteAddress ) ) { if ( localAddress . getPort ( ) == getAuthPort ( ) ) { if ( request instanceof AccessRequest ) { response = accessRequestReceived ( ( AccessRequest ) request , remoteAddress ) ; } else { logger . error ( "unknown Radius packet type: " + request . getPacketType ( ) ) ; } } else if ( localAddress . getPort ( ) == getAcctPort ( ) ) { if ( request instanceof AccountingRequest ) { response = accountingRequestReceived ( ( AccountingRequest ) request , remoteAddress ) ; } else { logger . error ( "unknown Radius packet type: " + request . getPacketType ( ) ) ; } } else { } } else { logger . info ( "ignore duplicate packet" ) ; } return response ; }
Handles the received Radius packet and constructs a response.
Handles the received Radius packet and constructs a response .
// check for duplicates
 // handle packets on auth port
 // handle packets on acct port
 // ignore packet on unknown port
