PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Establishing a persistent HTTP connection (keep alive) and receiving multi-part HTTP responses
Establishing a persistent HTTP connection (keep alive) and receiving multi-part HTTP responses
Débuté par johntm, 10 nov. 2023 22:55 - Aucune réponse
Posté le 10 novembre 2023 - 22:55
Hi,

I've been struggling with finding a way to get WinDev's HTTP functions to start a persistent HTTP connection with a server, and then have the client program receive a constant stream of multi-part HTTP responses. This is for a program that needs to be able to subscribe to events from a remote server, and one of the ways to do this is to establish a persistent HTTP connection that doesn't close but rather sits open, receiving HTTP responses from the server that describe events as they happen. These are structured as multipart content, as described here:

https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

As it works now, the program establishes a connection to the API endpoint, and the server doesn't close the connection because it is sending events. The WinDev program never returns from HTTPSend, but I confirmed with a packet sniffer the connection is receiving the data I want, it's just that WinDev doesn't seem to know what to do with this.

I tried asynchronous HTTPSend as well, hoping it would invoke the callback each time, but it doesn't do anything either.

What are my options to deal with this? Am I going to need to code this from the ground up with sockets or use an external library? Or is there some functionality in WinDev I am missing?