There are probably more elegant ways to handle this but oh well, here goes...
Code Select
private bool m_Active = true;
...
//initialize everything
while (m_Active)
{
//handle something here, be it sockets or console commands
//m_Active = false; to shutdown
}
//dispose unmanaged resources, shut down the bot