[Nearby] Unblock BT socket input/output stream read/write after close
The Bluetooth socket implements its own input/output streams. During Read()/Write(), we wait until a base::WaitableEvent is notified that the read/write finished. Previously, if Close() is called while the read/write is waiting, the base::WaitableEvent will never be notified. In this CL, we notify the base::WaitableEvent after closing the stream. In practice, this CL fixes the blocking Read() on the receiving Chromebook after the first successful file share. The Read() was waiting for more bytes to appear in the receive stream, which would trigger ReceiveMore(), but those bytes never came because the transfer already completed. This blocking Read() prevented receiving again after the first successful file share. See the following debugging logs from the receiving Chromebook at the end of a successful transfer; the fix is explicitly noted in the logs: https://paste.googleplex.com/4940385051738112. Fixed: 1137673 Change-Id: I0e15aeb5ece9609faea7549b8617a404cb2c145c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2467336 Commit-Queue: James Vecore <vecore@google.com> Reviewed-by:James Vecore <vecore@google.com> Auto-Submit: Josh Nohle <nohle@chromium.org> Cr-Commit-Position: refs/heads/master@{#817056}
Showing
Please register or sign in to comment