holy. freaking. crap. I didn't know there was an argument to the connect callback - the sample code I found didn't have an arg. And yes, putting them inside the callback and using 'socket' made it work. I am now seeing the 0xEF packets being sent. Solved all of the confusion.
As for the UDP code, it does work, but I don't claim to have written it correctly, I'll change it to match the link you provided.
So thanks a million for the corrections!