Use multiple network interfaces in an app

前端 未结 3 635
灰色年华
灰色年华 2021-02-19 13:04

I wrote an app that is triggering a Sony qx smartphone attachable camera over wifi. However I need to transfer the images off the phone over another local network in real time.

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-19 13:46

    Just to give a little more explanation on how this finally got solved.

    Utilizing @alijandro's answer I was able to switch back and forth between Ethernet and Wi-Fi in one app. For some reason for the Ethernet to work it required the network gateway to supply DHCP address, not static. Then since the bindProcessToNetwork, used in @alijandro's answer is per-process, I decided to split communications with the QX camera into a Service that runs in a separate Process. The main Application (another process) would post images over Ethernet to a local network. I was successfully able to contact the devices on the local network via HTTP over Ethernet while simultaneously triggering the QX over Wi-Fi. Currently, I used Messenger to communicate using IPC to tell the QX triggering Service what methods to call.

提交回复
热议问题