Use log module, implement recv function. Some little refactor and update the cfg...