我很好奇如何处理这个问题;我目前有一个带有 TDSAuthenticationManager 类管理身份验证的 DataSnap 服务器设置。
如果身份验证失败,我可以直接在 TMemo 或类似的表单上写入以进行日志记录吗?观察这一点的最佳方法是什么?
我需要穿线吗?
为阅读干杯,阿德里安
Yes, you need synchronization, since Datasnap events run in the context of different threads, and as you may know, the UI programming is limited to the main thread.
So, if you want to display something in the UI, you have to take care of how to do it.
On the other hand, if you want to log to a file, you don't need synchronization, but you have to be careful, since it is possible for two different threads to try to log at the same time.
The options I would evaluate are:
Since servers tend to run as a services in production environments, I would choose the latter.