You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project using CMake for generating Makefiles:
$ cmake .
$ make#### For testing against installed tarantool
$ make test#### For building documentation using Doxygen
$ make doc#### For installing into system (headers+libraries)
$ make install
Or you can install it using yum/apt into your favorite linux distribution
from tarantool's repository
Examples
Start tarantool at port 3301 using this command:
box.cfg{ listen='3301' }
After you've installed tarantool-c build and execute this code:
#include<stdlib.h>#include<stdio.h>#include<tarantool/tarantool.h>#include<tarantool/tnt_net.h>#include<tarantool/tnt_opt.h>intmain() {
constchar*uri="localhost:3301";
structtnt_stream*tnt=tnt_net(NULL); // Allocating streamtnt_set(tnt, TNT_OPT_URI, uri); // Setting URItnt_set(tnt, TNT_OPT_SEND_BUF, 0); // Disable buffering for sendtnt_set(tnt, TNT_OPT_RECV_BUF, 0); // Disable buffering for recvtnt_connect(tnt); // Initialize stream and connect to Tarantooltnt_ping(tnt); // Send ping requeststructtnt_reply*reply=tnt_reply_init(NULL); // Initialize replytnt->read_reply(tnt, reply); // Read reply from servertnt_reply_free(reply); // Free replytnt_close(tnt); tnt_stream_free(tnt); // Close connection and free stream object
}
For more examples, please, visit test/cli/tarantool_tcp.c or test/tarantool_unix.c files.