Cak libzt be used in the same way the official ZeroTier client can?


I have a few simple questions, just to see if I understood the purpose of the libzt properly.

If I make a C application that links in libzt and, when run, calls zts_start(…) + zts_join(), and then run that app on 2 different computers, those computer will be able to ping each other (and otherwise communicate) using the Managed IPs found on the network dashboard (after they are authorized in the group), correct? Assume that all the required events are produced as expected (NODE_UP, NODE_ONLINE etc.)

Basically - if will behave as though I had installed the official ZeroTier client on those computers?

Is libzt compatible with using other socket interfaces (for example, WinSock or SFML.networking), or do I have to use the provided zts_* functions in order for it to work?

Is there a relevant difference in how ZeroTier handles TCP and UDP comunication?

Thanks, Cheers :slight_smile:

No. libzt allows you to add an application to a network and only that application will be able to communicate over it via the zts_* functions. It is not a full zerotier-one client that adds a virtual network adapter to the machine, and no other programs running on the computer will be able to communicate on the network unless they too are using libzt, or there’s a full zerotier install on the machine.

libzt can only communicate over networks via the supplied zts_* function interfaces.


Thank you, that explains a lot.
Next task: learn how to use ZT sockets :slight_smile:

That part should be pretty straightforward. For C, it’s modeled after the classic Berkeley socket interface. All the function names are the same, but prepended with zts_. Everything else should remain the same. You can also check here for Beej’s Guide to Network Programming. It’s pretty much the defacto guide to network programming with C. Been around forever and is still updated.

Wow, this guide is awesome - exactly what I need! Thanks again :slight_smile: