Forum Discussion

VTE_Man_97174's avatar
VTE_Man_97174
Icon for Nimbostratus rankNimbostratus
Aug 04, 2009

trigger server_data event from within client_data

is that possible? is there a way to force processing of the server_data event in response to some client event? I think I understand from the TCP::notify documentation that it's possible to trigger user_request and response events. I was just curious if there was a way to force processing of server_data based on a client event.

3 Replies

  • According to the documentation SERVER_DATA event is triggered when new data is received from the target node after TCP::collect command has been issued. So I suppose you could base in the following:

     

     

     
     when CLIENT_ACCEPTED { 
          TCP::collect 
     } 
     when SERVER_DATA { 
           code here 
      { 
     

     

     

    However, I have never tested anything like this. So a bit of experimentation might be needed or someone in the forum that has done this could respond with a better answer.

     

     

    I hope this helps,

     

    CB
  • spark_86682's avatar
    spark_86682
    Historic F5 Account
    There is no way to do that. SERVER_DATA is only triggered when the server sends data and there's a TCP collect on the server side. You can't be guaranteed to start that collect in CLIENT_DATA because there may not be a server side connection yet. The best way is to set a variable in whatever event you are in when you know you need to collect server data, and then do something like:

     
     when SERVER_CONNECTED { 
       if { $need_to_collect } { 
         TCP::collect 
       } 
     }