socket_wrapper: sync missing stuff from v4-0-test