On Tue, Feb 06, 2007 at 04:47:55PM +0100, Stef Coene wrote:
We want to (mis)use the hobbit client-server communication to send oracle information to a hobbit server. Thx to Henrik for the perl demo, I know how to write a perl script that I can use on the hobbit server to receive the information by hooking it in the a channel.
I can use the client channel for this, but I think it's better if I create an extra channel for this. I took a quick look at the code, but I can barely and understand the code :(
So, has anyone changed the hobbit server code and added an extra channel and want to share his changes ?
The attached patch should do it. It creates a "user" channel that is fed the messages you send with $BB $BBDISP "usermsg HOSTNAME ... your custom message here ..."
On the server side, run hobbitd_channel --channel=user YOURCUSTOMCOMMAND to pick up the messages.
I've set the max size of such messages at 128 KB (random number), but you can tune it by setting MAXMSG_USER to something else and restarting Hobbit. Note that as always, OS limits may need to be tweaked since this adds an extra shared memory segment and a couple of semaphore items. If you suddenly cannot start Hobbit and it complains about "cannot setup user channel", then that's your problem.
Henrik