if you mean a bot as an an autonomous player, you don't need a server socket connected to the game client in your final code.
to figure out the protocol, you should have a server and client socket connected to the game client and game server respectively. have the client socket send anything the server socket hears and vice versa. they should also print the traffic on the console. play the game, and use the data to reverse engineer the protocol.
then you just need to have your program use that protocol to control the character.