4d-database

how to programmatically reject new connections on 4d v17?


are there commands similar to WEB STOP SERVER and STOP SQL SERVER but to reject new connections on my 4d server?


Solution

  • i found out that by using the On Server Open Connection Database Method , i can reject new connections by returning a value different than 0 as seen in the doc

    If you do not return a value in $0, thereby leaving the variable undefined or initialized to zero, 4D Server assumes that the database method accepts the connection. If you do not accept the connection, you return a non-null value in $0.

    so i just change the return value $0 under the conditions i need

    If(*some conditions*)
      $0:1
    End If