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?
[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]