Simulating sleep

I have an intermittent issue where the GUI client will not reconnect to the remote command-line server after the client machine sleeps for a bit. (Both sides are written in Xojo and the GUI has code to detect a disconnection and automatically reconnect.)

I want to simulate true sleep in the GUI client without actually having to keep putting my Mac to sleep. Any suggestions?

Not sure there is any way to simulate sleep that will do the same as actually sleeping


[code]Declare Function NSClassFromString Lib “Cocoa” (aClassName As CFStringRef) As Ptr
Declare Sub sleepForTimeInterval Lib “Cocoa” Selector “sleepForTimeInterval:” _
(NSThread As Ptr, NSTimeInterval As Double)

Dim threadClassPtr As Ptr = NSClassFromString(“NSThread”)
sleepForTimeInterval(threadClassPtr, 2.5)[/code]

might as well just call sleep current thread

but thats not the same as sleeping the computer