+ 1
You need to learn about networking. It will probably use similar techniques as multiplayer games, so googling information about that is a good place to start. You should also try looking for a YouTube tutorial about a multiplayer chat in the programming language you want to use.