Raw UDP sockets - how?

Hi all,

I have to write an app targeted for Windows & Mac, which communicates with routers over what’s known as MAC telnet. It involves writing UDP packets to broadcast (255.255.255.255) but the destination router’s MAC address, and a specific port.

While Xojo doesn’t seem to have built-in low-level sockets, MBS Network plugin has a “raw UDP socket” example, which comments “needs to run as root”. On most OSs, low-level stack access requires elevated privileges, I’m just not sure how this is done via the Xojo IDE while developing.

In short:

  1. How does Xojo run and/or build with “root” permissions under macOS? (running Mojave now)

  2. Does anyone have info on raw UDP sockets under Xojo? I’m getting close to building a C helper app that is then called via shell, but that’s ugly.

I take it that UDPSocket doesn’t work?

Xojo doesn’t need root permissions to build. But, to Run with root permissions you might want to use Run Paused then:

  1. open terminal
  2. use sudo to run your application with elevated permissions

Jason is right.

RawSocketMBS allows you to do all yourself. Any protocol if needed, but that needs root.
And if you write all headers yourself, you can fake the MAC address.