I’m working on something that talks to a server and just noticed something odd when testing it on Windows.
It’s nothing complicated, it’s basically just two requests that I send and then evaluate the response. Like this:
if(some_condition)
{
auto url = URL()
.withNewDomainAndPath(config.getBaseURL() + config.licenseCheckEndpoint)
.withParameter("payload", JSON::toString(payload));
WebInputStream wis(url, true);
wis.withExtraHeaders(someHeader);
if(wis.getStatusCode() == 200)
{
auto responseBody = wis.readEntireStreamAsString();
// do something based on the response
}
}
Works like a charm on macOS, and also on Windows, but with a hidden twist.
The server is currently a Django server, and when the plugin runs I see the requests in the log output. Everything works, suspiciously a little slower than on mac though. But when I then close the plugin (or Standalone version, doesn’t matter) an error message "Broken Pipe from (‘127.0.0.1’, 60821) appears in Django’s output.
So it seems that the connection might not be closed correctly. WebInputStream doesn’t have any functions to explicitly close the connection, right? It should clean up after itself with the destructor. But it might not do so.
Happens with both JUCE 7.0.12 and the current juce8 preview branch.
Anybody else seeing similar problems?
