botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
BotSense Client

Modules

 libbotsense Man Pages
 

Detailed Description

Intro

The BotSense client communicates with the bsProxy server through a messaging protocol transmitted and received over an IP socket interface. The libbotsense library provides a functional interface for the client application, hiding the underlining messaging.

bsLibReqRsp-Small.png
Figure 5: libbotsense Request/Response Design.

click to enlarge

Although a client may use the libbotsense library directly, typically, a client interfaces with an application-specific plug-in library module. The plug-in library makes the appropriate calls to the lower libbotsense layer.

In Figure 5, the high-level, internal control and data flows are illustrated for a client to server request/response message exchange. An application-specific plug-in normally makes the call to bsClientTrans(), checks for errors, and parses the application-specific response. The plug-in library is not shown for clarity.

The sequence:

  1. The client's calling function issues a transaction request. The call contains the packed request body (if any) and a buffer to hold the packed response.
  2. libbotsense prepends the message header to the body and transmits the message to the bsProxy server.
  3. Until a timout, error, or the response has been received, repeat:
    1. Check the transaction cache for an already received response. (This could have happened in another client thread.)
    2. Receive a response from the server. If not the response for this transaction, then cache it.
  4. Return to the client's calling function.

The locking and unlocking mutal exclusion are done at a per client level, uneffecting other clients. There is also one transaction cache per client. This design has been optimized for maximal multi-threaded performance.

The libbotsense library: