Alrighty, ur in the game you click a NPC, you click to buy an item. It then sends a packet to the server seeing if you have enough money an so on if you do it sends a packet back? Would that be correct? If not can someone help me?
Are you using *nix or Windows. For Linux you can basically learn off the manual documentation (i.e man 7 socket). For Windows socket programming I recommend referrencing the Microsoft's website http://msdn2.microsoft.com/en-us/library/ms740673.aspx it'll provide documentation and tutorials for both Winsock and Winsock 2 programming.
For you question my answer is no, usually a client side module or program will check to see if you've got enough money to buy something. As for updating your current balance, sometimes the client will buffer and send an update at certain intervals or might just send it when the current balance changes; it all depends is what I mean.