This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 months ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我已经发现了问题所在。 建立连接和消息侦听器后,服务进入 Thread.Sleep(500) 循环。 哑的。 我重构了该服务以在 OnStart 中启动所有内容并在 OnStop 中处理它。
自从这样做以来,一切都运行得很完美。
键盘和椅子之间发生的经典 ID-10-T 错误。
I have discovered the problem. After establishing the connection and the message listener the service went into a loop with Thread.Sleep(500). Dumb. I refactored the service to start everything up in OnStart and dispose of it in OnStop.
Since doing that, everything is running perfectly.
Classic ID-10-T error occurring between keyboard and chair.
我的代码有点不同。 我设置了一个响应“OnMessage”事件的侦听器,而不是循环轮询。 我的代码类似于下面的代码。 我的实际代码中有很多不相关的东西,但精神是一样的。
My code is a little different. Instead of polling in a loop I set up a listener that responds to an "OnMessage" event. My code is similar to the code below. My actual code has lot of irrelevant stuff in it but the spirit is the same.