简体   繁体   English

如何获得RAS断开连接的原因

[英]how to get RAS disconnect reason

Working on USB Modem, Used RAS interface for dail/hangup. 在USB调制解调器上工作,使用RAS接口进行拨号/挂断。

  • For connection used RASDial() and for disconnection used RASHangUp() API's. 对于连接使用RASDial(),对于断开使用RASHangUp()API。
  • After successful connection waiting for the disconnect event using function RasConnectionNotification(rasHandle, event, RASCN_Disconnection), event notifies successfully when disconnect happens. 成功连接后,使用函数RasConnectionNotification(rasHandle,event,RASCN_Disconnection)等待断开事件,事件在断开连接时成功通知。
  • I need to find out the reason of disconnection, if it disconnect due to lost network signal then put my application on auto reconnect. 我需要找出断开连接的原因,如果由于丢失网络信号而断开连接,则将我的应用程序置于自动重新连接状态。

Is there any method or API which provides the reason for disconnection like LINK_FAILED, USER_SWITCH, USER_LOGOFF ... etc. 是否有任何方法或API提供断开连接的原因,例如LINK_FAILED,USER_SWITCH,USER_LOGOFF ...等。

RasGetConnectStatus API可以在RASCONNSTATUS .dwError字段中提供原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM