You can just use the same old thing for internet networking, just connect to ips or domains instead. If you wanted to make an app that could automatically link people together (like GameSpy or something), you would need to have a server running constantly at some address (let’s just say mygameserver.com for now) that your game automatically connects to when looking for internet games. The app running on this server saves a person’s ip automatically when they log in and similarly gets rid of it when logging off, then displays a list of the ips.
Perhaps add in the ability to double click an ip to form a connection with it and you’re good to go. Your server app can then pass this ip on to the actual game, which you plug in to your Socket, just like on a local level.
If you already understand sockets on a local level, it’s really very simple to go over the whole internet. And you don’t even need to make a server of any kind if you don’t want, you could just have people figure out ips on their own.
Good luck, I hope that made sense to you.