OnAttachProcess - cWebApp

When process pooling is used, this event is sent to every WBO object and finally to the parent WebApp object

Type: Event

Parameters: None

Syntax
Procedure OnAttachProcess 

Description

When process pooling is used, the OnAttachProcess event is sent to every WBO object and finally to the parent WebApp object. By default, it does nothing, but it can be used to perform any initialization for the newly attached process.

Sample

This sample shows how to obtain the value of the IIS server variable HTTP_X_FORWARDED_FOR during OnAttachProcess. See Microsoft's MSDN for documentation of IIS Server Variables.

Procedure OnAttachProcess
    String sIP

    Get ServerVariable of oCustomer "HTTP_X_FORWARDED_FOR" to sIP
    If (sIP = "" or Lowercase(sIP) = "unknown") Begin
        Get ServerVariable of oCustomer "REMOTE_ADDR" to sIP
    End

    Send LogEvent 3000 sIP

    Forward Send OnAttachProcess
End_Procedure