make the C library have callbacks to make rebinding after connect sane