Answer the question
In order to leave comments, you need to log in
User LongPoll how long will the script run?
Hello, with this code
$activ = true;
while ($activ = true) {
$longPoll = $vk->Messages()->getLongPollServer($token); //Получаем данные сервера LongPoll
$data = "https://{$longPoll['server']}?act=a_check&key={$longPoll['key']}&ts={$longPoll['ts']}&wait=25&mode=2&version=3";
$d = file_get_contents($data); // Получаем последние события аккаунта (сообщения и тд)
}
Answer the question
In order to leave comments, you need to log in
Yes, LongPoll can break. For a million reasons. So better use Callback instead
just so nothing should break
in the worst case, the server may return errors that can be handled
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question