使用硬件和超时 .net

发布于 2024-10-06 03:11:13 字数 217 浏览 0 评论 0原文

我们正在实施用于 CrediCard 付款的读卡器终端,我有一个关于超时的问题。终端通过网络连接。如果我们没有现有连接,我们会尝试连接到客户提供的 IP 地址。

如果连接成功,终端将回答“已连接事件”,否则我们根本不会收到事件。那么我该如何处理.net中的超时呢?即使终端获得连接,也可能需要长达 10 秒的时间才能发送事件。关于在哪里可以找到有关超时的信息,有什么建议吗?或者还有其他好的提示吗? :)

We are implementing a CardReader Terminal for CrediCard payments and I have a question about timeouts. The Terminal is connected trough the network. If we dont have an existing connection we tries to connect to the ip-adress given by the customer.

The terminal will answer with an "Connected Event" if it succeeds in connecting, otherwise we dont get an event at all. So how can I handle the timeout in .net? Even if the terminal gets the connection it can take up to 10 seconds before the event is sent. Any suggestions for where I can find information about timeouts? Or any other good hints? :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风苍溪 2024-10-13 03:11:13

我假设在连接时,对 connect 方法的调用会阻塞线程,对吗?因此,您所要做的就是创建一个线程并从那里调用 Connect 方法。然后你可以有一个你想要的时间间隔的计时器,当计时器触发时,如果你没有连接,你将中止线程。

I assume that while connecting, the call to connect method is blocking the thread right? So all you have to do is to create a thread and call Connect method from there. Then you can have a timer with the interval you wish, when the timer triggers and if you are not connected, you will abort the thread.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文