TCP / IP客户端发送和接收超时

编程入门 行业动态 更新时间:2024-10-23 04:50:28
本文介绍了TCP / IP客户端发送和接收超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,我正在使用以下TCP / IP异步套接字示例来执行我​​的应用程序。 msdn.microsoft/en-us/ library / bew39x2a.aspx 我的程序将使用TCPIP连接向Unix主机服务器发送ISO8583财务消息。问题是,有时在我的客户端程序向Unix服务器发送消息后,消息甚至没有到达服务器。 所以,没有响应从服务器发回。在这种情况下,客户端程序应该达到发送/接收超时间隔并应该停止通信。 但是,它没有发生这种情况。程序一直运行,直到任务管理器手动关闭它为止。 因为,这个客户端程序被Web界面调用,向Unix主机发送财务信息,还有很多客户端程序实例保持打开状态在任务管理器中。 但是,这种情况只发生了几次。在任务管理器手动关闭后,该过程按预期运行。 在这种情况下我想知道的是, - 为什么消息没有发送out to server? - 为什么超时并没有真正触发并关闭客户端程序? 提前谢谢, >


Myo Zaw

Hi,I am using the following TCP/IP Asynchronous socket example to do my application.msdn.microsoft/en-us/library/bew39x2a.aspxMy program will use TCPIP connection to send ISO8583 financial message to Unix host server. The problem is, sometimes after my client program sent out message to Unix server, the message didn't even reached to server.So, there will be no response sending back from the server. In this case, the client program should reach to send/receive timeout interval and should stop the communication.But, it didn't happen like that. The program was keeping running until manual shut down to it by the task manager.Since, this client program was called by web interface to send financial message to Unix host, there are a lot of client program instances left open in task manager.But, this case is happening only some times. After manual shut down at task manager, the process run as expected. What I would like to know in this case is,  - why the message didn't sent out to server?  - why the timeout is not really firing and shut the client program down?Thanks in advance,


Myo Zaw

推荐答案

在套接字上发送消息后,您可以保证其中一个两件事: 1)远程机器接收到消息。 2)您收到错误消息无法传递消息。 输入消息是不可能的"中间状态" ;.仔细检查是否收到了。 -Steve Once you send out a message on a socket, you're guaranteed one of two things:1) The message was received by the remote machine.2) You get an error back that the message could not be delivered.It's not possible to just have a message enter "limbo". Double-check whether it's getting received.        -Steve

更多推荐

TCP / IP客户端发送和接收超时

本文发布于:2023-11-25 09:06:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629158.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   TCP   IP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!