Previous Article
Return to Newsletter

Jungle Rhythms on the Web


With version 12.0, Dyalog includes Conga. Like the jungle drum after which it is named, Conga is a tool for remote communications. Unlike the drum, which uses sound waves, the modern version of Conga allows you to communicate across the globe using TCP Sockets. These sockets are bi-directional connections between two programs, based on a protocol called TCP-IP (Transmission Control Protocol-Internet Protocol), which is the lingua franca of web servers and most other communicating software. They are available on virtually every operating system and network in use today.

Conga can be used to transmit APL Arrays between two Dyalog applications which are both using Conga, but it can also be used to exchange messages with other partner applications, like HTTP Servers (these are the "Web Servers" that we all use on a daily basis), Web Services (using SOAP), and other network applications. Conga also allows your application to provide services which can be used by Web Browsers and other client applications.

Uses of Conga include, but are not limited to the following:

  • Retrieving information from – or "posting" data to – web pages.
  • Accessing internet-based services like FTP, SMTP, or Telnet.
  • Writing a Dyalog application that acts as a Web (HTTP) Server, Mail Server or any other kind of service available over corporate intranets and the internet (or even within a single machine).
  • APL "Remote Procedure Call" servers which receive APL arrays from client applications, process data, and return APL arrays as the result.

From version 12.0 of Dyalog APL, Conga replaces the use of the built-in TCPSocket objects as the recommended mechanism for managing most TCP communications from Dyalog APL. TCPSocket objects will continue to be supported, and have indeed been enhanced in Version 12.0, to support UTF-8 encoding of data. However, the programming model for Conga is significantly simpler. The screen shot below shows the code required to use a UNIX service like the Time of Day service:



Very briefly: Create a Text mode client called C1, connected to port 13 on the machine known as localhost. Wait for a response for up to 1000 milliseconds, and extract the data portion of the result.

The multi-threaded design of the Conga API makes it straightforward to start additional threads in an application to provide a service in parallel with the main application. For instance, writing n-tier architectures, where the same program provides a service but is itself a client of higher-lever services and possibly providing an event-based GUI at the same time, is much easier than it was before.

In the Pipeline

Future investments by Dyalog into communications services are likely to be based on Conga. In the pipeline are:

  • Support for the Secure Socket Layer (SSL), allowing Dyalog users to develop secure web applications based on internationally recognized certificates, which can be used to guarantee the identity of your communications partner, encrypt data to prevent it from being accessed by unauthorised parties, and allow you to verify that received data has not been tampered with. SSL support will be included with version 12.0.2, in April 2008.
  • A Stand-Alone Web Service (SAWS) Framework: "Web Service" is a protocol which is supported by many development tools, across most platforms. It uses SOAP to exchange XML-based messages. SAWS will allow Dyalog applications to easily expose functionality in the form of Web Services, without the use of a third party framework like Microsoft IIS or Apache, SAWS will not be included with v12, but will be sold separately. To keep your application service up and running round the clock (even if the machine it is running on is restarted), a tool to run your application as a "Windows Service" will be included.

Extensive Samples

Conga is delivered with a set of samples which illustrate how to write Conga applications, and can be used as building blocks for your own communicating applications. Thanks to the simplicity of the Conga programming interface, most of these samples only contain one or two pages of code. Samples include:

  • Retrieving pages from web (HTTP) servers.
  • An implementation of a standard "Time of Day" service.
  • A Remote Procedure Call framework based on transmission of APL arrays.
  • A simple Web Server, supporting the "serving" of pages stored in files on the server, plus generation of HTML by user-defined code embedded in the server.
  • Telnet Client and Server applications.
  • An FTP Client application.

In 2008, Dyalog plans to provide additional Conga-based samples, including:

  • Code for sending and retrieving e-mail using SMTP and POP3 protocols.
  • A complete (but easy to use) Web Server framework, based on Stefano Lanzavecchia's WildServer

The examples will be posted on the Dyalog web page and the APL Wiki, when they are available.

 

Previous Article
Return to Newsletter