modules instantiation
    Alan DeKok 
    aland at deployingradius.com
       
    Sat Feb 20 03:07:15 CET 2010
    
    
  
Latha Krishnamurthi wrote:
> I see that a new instance is getting created when the first one is busy
> handling a request. (I do this this by adding a sleep in the module and
> printing the threadid) I am expecting the xxx_instantiate function to
> get called each time a new instance is created (reading in the
> documentation).
  No.  The module is NOT having "a new instance created".
  A module "instance" is defined by a module configuration.  One
configuration: one instance.
  The "instance" data is *constant*.  The module gets called multiple
times simultaneously from multiple threads when multiple requests are
received.
> This does not happen. I am actually connecting to a
> server in the instantiate function and storing the socket id in the
> *instance, so that I can use it later in the authenticate etc.
  Why?
  Is that connection changing the way the module behaves?
> But it seems that the socket id is the same for all the instances.
> *instance seems to be shared by all the instances ??
>  
> Am I missing something/configuration, your help is grately appreciated.
  If you need to store data that is associated with a particulare
*request*, and is valid only for the lifetime of a request, see
request_data_add(), and request_data_get().
  Alan DeKok.
    
    
More information about the Freeradius-Users
mailing list