// we close the connection when deconstructing the bot IrcBot::~IrcBot() { luaInterface.closeState(); pythonInterface.closeState(); close (connectionSocket); // close the socket }