2

Is there a way to have two instances of my UWP app running on two devices communicate with each other using a USB cable? I was looking at UsbDevice and the MSDN tutorial for bulk transfers, but I can't seem to find a way to connect two computers. It looks like it's just for storing files on "regular" USB devices.

So, is there a way to send messages through a USB cable connected to two computers from one instance of an app on one computer to another one on another computer?

ispiro
  • 26,556
  • 38
  • 136
  • 291
  • 1
    Why USB and not Ethernet? USB cannot work with 2 PCs unless there is an active mediator device included in the "cable". Ethernet could work with only a passive cable - but the PCs must be properly configured. – Turbo J Jul 09 '17 at 18:21
  • 1
    Follow http://www.hardwaresecrets.com/connecting-two-pcs-using-a-usb-usb-cable/ – Shaibal Jul 09 '17 at 18:29
  • @TurboJ `Why ... not Ethernet?` - Because I didn't know that would be better. Thanks! So how would I go about doing that? – ispiro Jul 09 '17 at 19:44

1 Answers1

0

If you take @Turbo J's suggestion of using Ethernet, one option would be to use sockets and use some form of data serialiasation - e.g. JSON (with JSON.net), though you'd have to find a way of getting the hostname of the remote computer hosting your app

MCL
  • 11
  • 3