simple hack to add basic callback mechanism

I have more than 50 functions which I plan to use the same socket for.
Subsequently the code would be unreadable and nothing were I'd normally
look. Using this simple hack(?) I can keep there code where
it should be.
add timeout parameter to callback

getting closer to the point were different callbacks should be used.