X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=doc%2Findex.doc;h=395603df0a83b805cb72dc0dc9bc7bcfacce9ee2;hp=b9caffafcd7f9f7734b8835a434103bdb832d59c;hb=refs%2Ftags%2Fv0.2;hpb=3e11fd2cfda1d68b7bc825ae5c10515f4a8b7f86 diff --git a/doc/index.doc b/doc/index.doc index b9caffa..395603d 100644 --- a/doc/index.doc +++ b/doc/index.doc @@ -2,26 +2,22 @@ \section intro_sec Introduction \par libt2n (talk to neighbor) is a C++ library for inter-process communication (IPC \ref notes1 "[1]") with an additional code generator (libt2n-codegen) to make C++ remote procedure calls (RPC \ref notes2 "[2]") simple. - \htmlonly -
- \endhtmlonly \par - Figure: Remote procedure call overview \ref notes3 "[3]" - \par - The figure shows an general overview of the steps involved in a remote procedure call. Using libt2n and its code generator only the server procedure implementations have to be written manually. The stubs are generated by the code generator and the inter-process communication routines are provided by libt2n. libt2n provides an abstract interface for +Using libt2n and its code generator only the server procedure implementations have to be written manually. The stubs are generated by the code generator and the inter-process communication routines are provided by libt2n. libt2n provides an abstract interface for \ref libt2n::connection "connections" - hiding the details of the concrete communication mechanism used. At the moment it is implemented for local sockets (a.k.a "Unix domain sockets") and TCP/IP sockets. + hiding the details of the concrete communication mechanism used. At the moment it is implemented for local sockets (a.k.a "Unix domain sockets") and TCP-sockets. (\ref libt2n::socket_client_connection, \ref libt2n::socket_server_connection) \par - The client procedure stubs provide an interface to the server procedure implementations. To call the server procedure the client stub procedure is called (step 1). The client stub procedure transforms the procedure arguments and signature including the procedure "name" into a sequence of bytes using boost serialization \ref notes6 "[6]". This byte sequence represents a request to call a procedure with those arguments (step 2). Using the communication routines of libt2n the request is sent to the server. (step 3,4). The server procedure stubs de-serialize the request and call the corresponding server procedure using the reconstructed arguments (step 5). The result of the server procedure is serialized and sent back to the client (steps 6,7,8). Finally the result is de-serialized on client side again and returned to the caller. (steps 9,10). + The client procedure stubs provide an interface to the server procedure implementations. To call the server procedure the client stub procedure is called. The client stub procedure transforms the procedure arguments and signature including the procedure "name" into a sequence of bytes using boost serialization \ref notes6 "[6]". This byte sequence represents a request to call a procedure with those arguments). Using the communication routines of libt2n the request is sent to the server. The server procedure stubs de-serialize the request and call the corresponding server procedure using the reconstructed arguments. The result of the server procedure is serialized and sent back to the client. Finally the result is de-serialized on client side again and returned to the caller. \par The input for the code generator is standard C++ code \ref notes4 "[4]" and you mark the procedures you want to expose to other processes. Because the interface is described in C++ directly there is no need for a interface description language (IDL, \ref notes5 "[5]"). - It then generates the client and server stubs needed. - \par - The exported procedures can be grouped. Each group maps to two classes (cmd_group_... and cmd_group_..._client) where the cmd_group_..._client class provides the interface to call remote procedures. Each remote procedure maps to a method of this class and the constructor takes a connection object establishing the binding to the remote side. For each group the code generator is called and generates 6 output files: group_common.hxx, group_common.cpp, group_client.hxx, group_client.cpp, group_server.hxx, group_server.cpp. The _common files are used by client and server whereas the _client files contain the client stub code (the cmd_group_..._client class) and the _server files the server stub code. + The code generator is used to create the client and server stubs for the marked procedures. The procedures can be grouped and each group maps to two classes (cmd_group_... and cmd_group_..._client). The cmd_group_..._client class provides the interface to call remote procedures. Each remote procedure maps to a method of this class and the constructor takes a connection object establishing the binding to the remote side. For each group the code generator is called and generates 6 output files: group_common.hxx, group_common.cpp, group_client.hxx, group_client.cpp, group_server.hxx, group_server.cpp. The _common files are used by client and server whereas the _client files contain the client stub code (the cmd_group_..._client class) and the _server files the server stub code. \par To simplify the build process a Makefile snippet is provided that allows to create a server program and a client library (including a corresponding .pc file) using the autotools easily. + \section License + The libt2n libaray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. The code generator (libt2n-codegen) is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + \section install_sec Installation \subsection requirements Requirements @@ -41,7 +37,10 @@ \endverbatim \subsection Usage - Take a look at the example file:../../../libt2n-examples/doc/html/index.html + Take a look at the \ref example. + + \subsection Homepage + The libt2n homepage with downloads and further information can be found at