What is WNPComm?

WNPComm (Warlock Named Pipe Communication) is a communication library based on named-pipe (fifo) IPC.

The library core is written in C. But binding libraries are available for the following programming languages:
  • Tcl/Tk
  • Perl

  • How does it functions?

    The WNPComm library implement a basic communication protocol that allows you to send and receive data using kernel managed buffers (named-pipes). The protocol may be splitted in three levels:

    Level 1 - Phisical level
    The functions belong to this level send and receve data directly from the file descriptor associated to the fifo. If you are sending a message the library will perform the following tasks:
  • Data is read from upper level
  • New headers are added. They are needed to reconstuct data correctly
  • This package is sent to the fifo file descriptor

  • When you are receiving data the procedure is the same in the opposite direction.
    Defragmentation: if data exceedes the buffer size then it will be splitted when you are sending it, and merged when you are receiving it. This operation will be performed in transparent way

    Level 2 - Package building
    The functions belong to this level collects data from upper level and produce a package ready to be sent, or they receive a package from the lower level and extracts data. These data are mainly the following:
  • Sender Process ID
  • Fifo filename where the client will read answer
  • The data you want to send

  • Level 3 - Session manager
    This level performs the following tasks:
  • Fifo channel opening
  • Concurrent access management (file locking)
  • Channel closing

  • Level 4 - Aplications
    This level contains functions that provide more complex services using functions that belong to the lower levels. The available applications are the following:
  • Concurrent communication (multisession)