Server side listening function

These codes are just for learning