Ivyware P2Pmsgcore Integration libraries ODBC · MAPI · MFC · VoIP · HTTP Melbourne, AU
Ivyware

Ivyware/P2Pmsgcore/Integrations

Bridges to the rest of the estate

Foreign APIs, wrapped in a hub

Each library here follows the same shape: a specialised hub whose primary context keeps pre-emptively pumping and routing messages, while a second dedicated pump serialises whatever the foreign API insists on serialising. The rest of your network never learns the difference.

P2PmsgODBC — SQL Server

Sample patterns, utilities and C++ source for the asynchronous integration of a SQL Server database into a P2Peer virtual network using ODBC. Integration is achieved through a P2PeerHubODBC object that can run as a standalone hub or be folded transparently into a service or an MFC application.

Load balancing comes from the split: the primary hub context pre-emptively and asynchronously pumps messages, while a SQL pump dedicates itself to the serial generation of the response message stream.

SQLconnect2server
Message handler that initiates a session through the ODBC SQLConnect() function.
SQLselect
Message handler that asynchronously accepts standard SQL statements and translates the result set into a P2P message stream via SQLPrepare(), SQLExecute(), SQLFetch(), SQLDescribeCol() and SQLGetData(). The resulting stream is transparently routed back to the request source.
SQLdisconnectServer
Message handler that terminates the session through SQLDisconnect().

The library can be customised for equivalent ODBC databases such as MySQL. Download P2PmsgODBC.

P2PmsgMFC — user interfaces

Sample patterns, utilities and source for the seamless asynchronous integration of MFC objects into a messaging environment — the piece that stops a desktop UI from blocking on the network.

  • P2PmsgTreeCtrl class, integrating CTreeCtrl with message manager objects.
  • Extensions for the CComboBox, CListCtrl and CTreeCtrl controls.
  • Extensions for CWnd.
  • Extensions for CDialog.

Download P2PmsgMFC.

P2PmsgMAPI — Outlook and mail

Sample patterns, utilities and C++ source for the asynchronous integration of MAPI into a Windows messaging environment, through a P2PeerHubMAPI object that can stand alone or be embedded in a service or MFC application.

  • Wrappers for the IMAPISession, IMsgStore, IMAPIFolder, IMessage and IMAPIProp interfaces.
  • A MAPI pump dedicated to the serial processing of the message stream carrying emails, alongside the pre-emptive primary hub context.
  • Customisable and extendable; suitable for sending mail via MAPI from C++.

Download P2PmsgMAPI.

P2PmsgVoIP — audio

Sample patterns, utilities and C++ source for integrating VoIP into a Windows messaging environment, shipped as a static library.

  • Integration through a P2PeerHubVoIP object, standalone or embedded in a Win32 service or MFC application.
  • Wrappers for the WAVEHDR and WAVEFORMATEX data structures.

Download P2PmsgVoIP.

AKAserva — HTTP and WebSocket server

A complete C++ web server built from the messaging framework, supplied with source and a Visual Studio solution. It is the clearest single demonstration of what a hub, a connection and a map add up to — and the server this site's predecessor was developed and tested against.

  • Concurrent client connections limited only by available system resources. Connection state changes are pumped through shared threads, which removes the need for dedicated threads or a thread pool.
  • Each client connection lives in a dedicated object capable of retaining state, or cookie-equivalent information.
  • Requests and responses use non-blocking I/O completion ports.
  • An incoming request is parsed into a single message, pumped, decorated with the requested information by handlers, then translated back into a response. Each message acquires and retains client state from both the originating request cookies and the connection object — optionally, client state is maintained without cookies at all.
  • Concurrent large file uploads, with the upper size limit set by NTFS.
  • Customisable handlers and stubs for GET, POST, HEAD, PUT, DELETE, TRACE, OPTIONS, CONNECT and PATCH.
  • Customisable parsing for the common headers — Accept, Host, Connection, DNT, Cookie and the rest.
  • WebSocket protocol handshake, response and subsequent full-duplex communication.
  • Runs as a service, in a console window, or under the Visual Studio debugger against most browser clients.

AKAserva represents work in progress and is subject to change without notice. Download AKAserva.

Reference applications

Two full Visual Studio solutions exist as working test benches for the libraries above.

AKAssms — SQL Server object explorer

  • Modelled on the SQL Server 2008 Management Studio utility, and intended both to demonstrate and to act as a test bench for P2PmsgODBC.
  • Contains an equivalent object explorer providing read-only access to most SQL Server 2008 R2 databases.
  • Depends on the kernel, P2PmsgODBC and P2PmsgMFC.

SQLmapi — table-driven mail dispatcher

  • Monitors a SQL Server table for email requests, dispatches each via MAPI, and updates the table to flag the mail as sent. Auto-synchronises on startup.
  • Intended both to demonstrate and to act as a test bench for P2PmsgMAPI.
  • Depends on the kernel, P2PmsgODBC and P2PmsgMAPI, with the appropriate projects contained in the solution.
  • Runs as a service, in a console window, or under the Visual Studio debugger. Developed and tested against Outlook 2013.

SQLmapi represents work in progress and is subject to change without notice.

Every library on this page is a free download, source included. Go to the downloads.

The pattern, once

Why they all look alike

Step 1

Derive a hub

Subclass the hub, give it the address the rest of the network will use to reach the foreign system. Nothing about the foreign API escapes past this boundary.

Step 2

Add a second pump

Register a target carrying its own pump. The foreign API — ODBC, MAPI, waveform audio — gets a thread that can block on it without stalling routing.

Step 3

Map the verbs

Bind one handler per operation. Results stream back to the requesting address as ordinary messages, so callers need no knowledge of the bridge at all.