W
wenxh1202
Unregistered / Unconfirmed
GUEST, unregistred user!
我的客户端socket程序连接有断开后重新连接的机制。当OnError事件中显示出10060错误时,我执行了
if (ClientSocket1.Active) ClientSocket1.Active := false;
ClientSocket1.Address := ServerHostAddr;
ClientSocket1.Port := ServerHostPort;
ClientSocket1.Active := true;
检测显示执行该语句后,socket的OnConnect事件被触发,应该是连接成功了吧?而且这时他能接收到服务端传来的消息。这时我一发送消息,再测试ClientSocket1.Active值为FALSE.而且消息发送失败。如何解决呢,谢谢!
if (ClientSocket1.Active) ClientSocket1.Active := false;
ClientSocket1.Address := ServerHostAddr;
ClientSocket1.Port := ServerHostPort;
ClientSocket1.Active := true;
检测显示执行该语句后,socket的OnConnect事件被触发,应该是连接成功了吧?而且这时他能接收到服务端传来的消息。这时我一发送消息,再测试ClientSocket1.Active值为FALSE.而且消息发送失败。如何解决呢,谢谢!