graceful shutdown of packetsock

dev
Tom Early 5 years ago
parent 6f55c2356f
commit a5c61d4444

@ -54,7 +54,7 @@
#define CFG_DIR "/usr/local/etc"
#endif
const std::string GW_VERSION("QnetGateway-626");
const std::string GW_VERSION("QnetGateway-810");
int CQnetGateway::FindIndex(const int i) const
{

@ -73,6 +73,8 @@ bool CUnixPacket::Write(const void *buffer, const ssize_t size)
bool CUnixPacket::Restart()
{
if (! m_host->IsRunning())
return true;
std::cout << "Restarting '" << m_name << "'... " << std::endl;
Close();
std::string name(m_name);
@ -94,6 +96,7 @@ CUnixPacketServer::~CUnixPacketServer()
bool CUnixPacketServer::Open(const char *name, CKRBase *host)
{
m_server = socket(AF_UNIX, SOCK_SEQPACKET, 0);
m_host = host;
if (m_server < 0)
{
std::cerr << "Cannot open '" << name << "' socket: " << strerror(errno) << std::endl;
@ -126,7 +129,6 @@ bool CUnixPacketServer::Open(const char *name, CKRBase *host)
return true;
}
m_host = host;
strncpy(m_name, name, 108);
return false;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.