5. Interface

Libnjaim provides 14 functions as programming interface.

Here is a common scenario (some steps are omitted, please refer to test.c) :

  1. Alice sends : "TYPE=CUSTOM NAME=Bob TEXT=1234" (TEXT field is session id).

  2. Bob receives : "TYPE=CUSTOM NAME=Alice/4.3.2.1:5 TEXT=1234".

  3. Bob calls uniaccept("Alice", 1234).

  4. Alice calls uniconnect("Bob", 1234).

  5. When both sides return ok, transfer data using unirecv and unisend.

  6. The two close the connection by calling uniclose.