add support for callbacks with socket.send()