Writing the main chat logic
摘要
This segment shows how to refresh the interface constantly to listen for new messages and update them on the screen. Also, you will create the logic to send new messages.