remove debug prints
dont cleanup socket on (re-) connect error
fix receive return codes on sock err, don't close again on multiple call to close
add broadcast test
some more tests and fixes for corner cases