My agk linux server app is randomly exiting, both the console and graphic templates. When I run it with debugging active I get this message:
Signal received: SIGPIPE (Broken Pipe)
For program LinusApp64, pid 6,018
I believe it crashes when the client disconnects.
Simple code to recreate the error:
Linux Server:
// Includes
#include "template.h"
// Namespace
using namespace AGK;
app App;
int iServer = -1;
void app::Begin(void)
{
iServer = agk::HostNetwork("NET", "SERVER", 1050);
}
int app::Loop (void)
{
agk::Sync();
return 0; // return 1 to close app
}
void app::End (void)
{
}
I'm using a Windows computer as a Client:
// Includes, namespace and prototypes
#include "template.h"
using namespace std;
using namespace AGK;
app App;
int iClient;
int iCount = 0;
void app::Begin()
{
}
int app::Loop()
{
iCount++;
if (iCount > 20) iCount = 0;
if (iCount == 1)
{
iClient = agk::JoinNetwork("NET", "CLIENT");
}
if (iCount == 10)
{
agk::CloseNetwork(iClient);
}
agk::Sync();
return 0;
}
void app::End()
{
}