I would say to maybe take a look at the ESX source code. ESX has some code that allows them to do server callbacks that returns data.