Can we change the library so that the socket is returned asynchronously?Which process/thread is the callsite in? Note right now the network service doesn't have any non-test sync calls that are called from the browser process (just a few in the renderer to support legacy web APIs related to cookies). If this is a worker thread, then another possibly is to run a nested message loop that's quit when the reply arrives. That would be slightly preferable to making the methods sync, since that has the risk of other code ignoring the warning and calling it later.On Wed, Oct 6, 2021 at 11:00 AM 'Josh Nohle' via network-service-dev <network-s...@chromium.org> wrote:Friendly ping.--On Fri, Oct 1, 2021 at 2:26 PM Ryan Hansberry <hans...@google.com> wrote:FYI +Ken Rockot, who originally helped us settle on NearbyConnections's use of [Sync] on //device/bluetooth/public/mojom/adapter.mojom.On Fri, Oct 1, 2021 at 9:41 AM Josh Nohle <no...@google.com> wrote:Hi everyone!--I work on cross-device--Chrome OS and Android--features like Nearby Share and Phone Hub that require a communication medium between devices. We already use Bluetooth and WebRTC; I'm adding support for WLAN (i.e., communication over TCP sockets) on Chrome OS: go/cros-nearby-wlan.The third_party library that we use, Nearby Connections, requires us to implement synchronous methods that involve TCP socket wrangling. Would it be possible to add the [Sync] attribute to CreateTCPServerSocket and CreateTCPConnectedSocket in network_context.mojom? We would also add a big warning that the sync signature should only be used for Nearby Connections.FYI, we needed to do something similar for Bluetooth.Thanks!Josh
You received this message because you are subscribed to the Google Groups "Nearby Share ChromeOS Eng" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nearby-share-chrom...@google.com.
To view this discussion on the web visit https://groups.google.com/a/google.com/d/msgid/nearby-share-chromeos-eng/CAK9bitbGDcb3r_713ushMBDKhGySuaqevxV506DdYzXY-Lu34Q%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "network-service-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAK9bitYF%2BRzC_%2BGxYFv0SkpDtXNJ2pL7PfX2pS1wvr2nq1%2BF8w%40mail.gmail.com.
Thanks for the response, John!The callsite is in a utility process (running the third_party/nearby Nearby Connections service), and this will run on a worker thread. To answer your first question, I spoke with the Nearby Connections library owners, and they want to keep their API synchronous to match the analogous library implementation for Android.I'm just not sure what's safest:
- Adding [Sync] to the network_context mojo methods and risk other clients abusing it.
- Add [Sync] to methods in a Nearby-Connections-specific mojo service that essentially wraps the network_context.mojom async methods.
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAK9bitY98qApDDLTUQThHENcx9Y2ADHQhaPuMvUpf3a0G%2Bma8Q%40mail.gmail.com.