ws reconnect wrapper with buffering