如何使客户端套接字保持连接状态

如何使客户端套接字保持连接状态

本文介绍了除非手动关闭/停止,如何使客户端套接字保持连接状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户端套接字c#程序和
一旦连接,它将获得要从队列发送的数据,
然后我有模块做发送和接收交易.
执行完此例程后,程序将返回到数据队列
再次处理/发送.在这种情况下,我的客户端套接字应该
距离不太近,这意味着它应该从一开始就保持连接状态
它连接到主机,并将反复查找队列数据
处理.

只有通过用户可用的单击或命令手动断开客户端连接后,客户端连接才会关闭.

问题是,一旦队列数据为空,并且几分钟没有事务,客户端套接字就会被挂起.
最好的问候,
yomikorr

i have a client socket c# program and
once it gets connected it will get data to send from queue,
then i have module to do a send and receive transaction.
after this routine the program will look back to the data queue
to process/send again. with this scenario, my client socket should
not be close, meaning it should stay connected from the start
it gets connected to host and will repeatedly looking for queue data
to process.

the client connection will only be closed if it is manually disconnected through a click or command available for user.

the problem is client socket gets hanged once the queue data is empty for some minutes of no transactions.
Best regards,
yomikorr

推荐答案


这篇关于除非手动关闭/停止,如何使客户端套接字保持连接状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 07:07