Updated main.cpp for basic server operation and listening loop.