SQLitening Support Forum

SQLitening Support => You've got Questions? We've got Answers! => Topic started by: Bern Ertl on November 18, 2008, 04:46:30 PM

Title: Exits
Post by: Bern Ertl on November 18, 2008, 04:46:30 PM
Fred, I'm not sure how to create the "exits" as you call them without modifying the source for the server (causing additional work in the future to reconcile with any updates), so I am wondering if you might adapt something like this in a future release:

SQLiteningServer.BAS
Quote...
'============================<[ Globals ]>=============================
GLOBAL glFlags AS LONG                       'General purpose flags
...
GLOBAL glLogFileNumber AS LONG               'File number for the log

'=========================<[ Exits File ]>=========================
#INCLUDE "Exitmacros.inc"


...

'========================<[ Connection Main ]>=========================
FUNCTION ConnectionMain(BYVAL rqpAddr AS QUAD PTR ) AS LONG
...
   ' Close Tcp and log it
   TCP CLOSE llTcpFileNumber
   IF (llFlags AND &H01) AND (glFlags AND %gbfLogConnDcon) THEN LogIt "Dcon #" & FORMAT$(llTcpFileNumber) & "  " & IIF$(ERR = 57 OR ERR = 0, "", "Unknown Reason")

   'Call an Exit Macro
   mDisconnected


END FUNCTION
...

ExitMacros.INC
Quote'  ==========================================================================
'  |                                                                        |
'  | SQLitening Server - Exit Macros                                        |
'  |                                                                        |
'  ==========================================================================

MACRO mDisconnected
   'Put exit code here
END MACRO