使用硬件和超时 .net
我们正在实施用于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设在连接时,对 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.