Hi, All:


I am now writting a RADIUS client program to leverage FreeRadius server. I am determining the client's thread mode for handling the authentication requests. There are two options I have.
Option 1, the RADIUS client maintians a datagram socket pool, whenever an authentication request comes (The request will come in a different thread), it tries to allocate a datagram socket to handle the request. With the same thread, the Access-Request packet is sent and the thread will be blocked to receive the access-accept packet. Of course there will a time out and retry operation. But in short, there will be only one outstanding request per thread and per datagram socket.
Option 2. Using multi-threading dispatch modle, the RADIUS client only maintains one or more datagram sockets which is shared by all outstanding requests. When a request is coming, it is put into a queue for handling. there is a backgroud thread is responsible to fetch requests from outstanding request queue and send the access-request packets out one by one. There is also another background thread for handling receive all the time. Whenever, there is a access-accept (or reject) packet received, it tries to match the outstanding request and change the status of the outstanding request. When the request is finished, it returns back to the caller thread.
I know there are pros and cons for each option. But more, I think the client thread mode should be symmetric to the thread mode of the RADIUS server if for gaining performance.
So could you please give some hints about how the server handling an incoming outstanding packet.
is the server spawn a thread to handle it until it is finished (return a packet or silently discard) in the same thread. Or the server can be configured to running a different threading mode?


Thanks a lot
Don

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to