TCP / IP客户端发送和接收超时 [英] TCP/IP Client Send and Receive Timeout

查看:441
本文介绍了TCP / IP客户端发送和接收超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


您好,我正在使用以下TCP / IP异步套接字示例来执行我​​的应用程序。

http://msdn.microsoft.com/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.

http://msdn.microsoft.com/en-us/library/bew39x2a.aspx


My 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客户端发送和接收超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆