Имя пользователя:
Пароль:
 

Название темы: Про RasApi (RasUnit)
Показать сообщение отдельно

Аватара для hasherfrog

Старый параноик


Сообщения: 2423
Благодарности: 85

Профиль | Отправить PM | Цитировать


Ошибка случается в InternetDial или RasClearLinkStatistics?

Добавлено:

Очевидно, в RasDial.
Если Вы используете код из Unit1.pas, который идёт вместе с rasapi.zip, хочу предупредить, что согласно PSDK, приложение не должно выходить после ResHangUp где-то в течении 3-х секунд.
Цитата:
An application should not call RasHangUp and then immediately exit. The connection state machine needs time to properly terminate. If the system prematurely terminates the state machine, the state machine can fail to properly close a port, leaving the port in an inconsistent state. Also, an immediate attempt to use the same connection may fail leaving the connection unusable. A simple way to avoid these problems is to call Sleep(3000) after returning from RasHangUp; after that pause, the application can exit. A more responsive way to avoid these problems is, after returning from RasHangUp, to call RasGetConnectStatus(hrasconn) and Sleep(0) in a loop until RasGetConnectStatus returns ERROR_INVALID_HANDLE.
В тектсе Unit1.pas никаких таймаутов я не наблюдаю.

Отправлено: 14:59, 04-08-2004 | #4

Название темы: Про RasApi (RasUnit)