Patch from Mattia Barbon to use block mode for passing messages back and
forth