IDK if they're called sockets in Java/C++, but look them up. It's how your program mimics a browser and tricks a website into thinking you're a user. That's step 1. After that, you'd learn common website vulnerabilities.
From what I've read, it's not exactly tricking a website into thinking you're a user.
It's more like duplicating the connection your browser application makes to one of Gaia's servers on your own terms.
If you're doing, uh, web based botting?
Like, just interfering with their web servers?
You don't really need to know anything about sockets.
More appropriately you'd need to be learning about the HTTP protocol and how your computer interacts with web servers.
The socket side if things would be more appropriate if you were making a bot that connected to Gaia's Town or Rally servers.
Sockets in themselves are really just a networking term to describe certain segments of the connection you make to a server.
I'd start with HTTP, web exploits, and then TCP if you're looking to do botting for Flash games (without the Flash).