Good way to send/receive UDP packets?
H. S. Teoh
hsteoh at quickfur.ath.cx
Sat Jul 18 18:04:57 UTC 2020
On Sat, Jul 18, 2020 at 04:00:09PM +0000, Dukc via Digitalmars-d-learn wrote:
> I have a project where I need to take and send UDP packets over the
> Internet. Only raw UDP - my application uses packets directly, with
> their starting `[0x5a, packet.length.to!ubyte]` included. And only
> communication with a single address, no need to communicate with
> multiple clients concurrently.
>
> I understand that I could do it either with the Curl library bundled
> with Phobos, or use Vibe.D or Hunt instead. But it's the first time
> I'm dealing with low-level networking like this, and my knowledge
> about it is lacking. So seek opinions about what library I should
> use, and more importantly, why.
If you already have the raw packets, there is no need for any library,
just call the OS's C API directly (such as core.sys.posix.sys.socket).
For UDP you don't even need to set up anything, just create a socket and
fire the packets away.
--T
More information about the Digitalmars-d-learn
mailing list