Libt2n
Encyclopedia
libt2n is a free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

 library which offers a simple way for C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

 applications to communicate with one another.

Introduction

libt2n is an inter-process communication
Inter-process communication
In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

 (IPC) system which is focused on ease of use an a minimum of code-lines needed to export and use methods. This is achieved by reducing the feature-set and relying on the serialization library developed at Boost.

The goals of libt2n development are:
  • easy to use, minimum of code-lines needed to export and use methods
  • handles complex C++
    C++
    C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

     structures like maps of vectors, etc.
  • passes exceptions
    Exception handling
    Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution....

     from the server back to the caller
  • easy integration into GNU Autotools and Pkg-config
    Pkg-config
    pkg-config is computer software that provides a unified interface for querying installed libraries for the purpose of compiling software from its source code. pkg-config was originally designed for Linux but is now also available for the various BSDs, Microsoft Windows, Mac OS X, and Solaris.It...



The limitations of the current libt2n implementation:
  • C++
    C++
    C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

     only
  • Synchronous, blocking, no callbacks
  • no server-side objects, just functions you can call
  • no threads
    Thread (computer science)
    In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

     or multiple server processes for handling multiple requests at once

Architecture

libt2n is divided in two parts:
  • The library which is linked to every client and server
  • The code generator used to create stubs
    Method stub
    A method stub or simply stub in software development is a piece of code used to stand in for some other programming functionality. A stub may simulate the behavior of existing code or be a temporary substitute for yet-to-be-developed code...

     and skeletons
    Skeleton (computer science)
    Skeleton programming is a style of computer programming based on simple high-level program structures and so called dummy code. Program skeletons resemble pseudocode, but allow parsing, compilation and testing of the code....



The code generator does not use an Interface description language
Interface description language
An interface description language , or IDL for short, is a specification language used to describe a software component's interface...

 (IDL), but parses the source code of the server for special tags. It produces the code needed to handle the calls on the server and a ready-to-use library for the client.

If a remote function is called, the client library creates an object describing the call, including all parameters. This object is serialized using the Boost serialization library and transferred to the server. Currently this can be done using Unix domain socket
Unix domain socket
A Unix domain socket or IPC socket is a data communications endpoint for exchanging data between processes executing within the same host operating system. While similar in functionality to...

s or TCP
Transmission Control Protocol
The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol , and therefore the entire suite is commonly referred to as TCP/IP...

. The server deserializes the object and calls the corresponding method. The result (return value or exception) is again serialized and sent back to the client.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK