Sockets Amplified
by John Schroeder

Sockets are an important feature enabling all BASIS products to communicate with any socket-aware application, including other PRO/5®, Visual PRO/5® or BBj® applications.

Sockets can assist an application by offloading some tasks from the client to the server. For example, a Visual PRO/5 client could send a request, via a socket, to a listener program running on the server. This request could be to have the listener start up a new session of PRO/5 to start a lengthy report while the client is then freed to do other work. Or the listener could send a command to a database program to start a job extracting data from the departmental BASIS database to the corporate database management system (DBMS). Also, sockets can enable data transfer between dissimilar systems. For example, e-mail can be sent from a BBx® or BBj program directly via sockets. You can query the Web or a host of other applications.

As long as two or more programs have the ability to communicate via sockets, there is no limit to what they can do to make an application more powerful and more able to share its data with outside systems.

One example of the use of sockets with BBx is the new sdOffice product from Synergetic Data Systems Inc. (SDSI). sdOffice uses sockets and other technologies, such as dynamic data exchange (DDE) on Microsoft Windows systems and pipes on UNIX systems, to enable programs to automate their interaction with Microsoft Office products. With sdOffice, you can use the supplied BBx-called utilities to create, format and update spreadsheets and Word documents from within your BBx or BBj application. sdOffice wraps calls to Office COM objects with a layer that can talk to a socket-based program. From within your BBx-based application, you can create spreadsheets on the fly and e-mail them to colleagues all over the world. Sockets provided sdOffice with a very clean and very powerful method of transmitting commands to an Office application and transferring data back to the calling program. SDSI has not yet released a BBj version of the product, but I have used it in BBj and have not run into any problems. Virtually anything you can do in an Office application can now be done from a BBx or BBj application.

Another application, developed by DISC Inc., uses PRO/5 socket capability to allow Web users to query the PRO/5-based DISC database. You can read more about this implementation in this issue's article, "With Sockets, DISC Bridges Internet For Distributors." You can also read about the socket implementation of Java Technologies, S.A. de C.V., which is using Visual PRO/5 socket capability to provide hotels with transaction processing through the Web. See the article, "BBj Sparks GUI Hotel Solutions."

A simple demonstration socket program is available on our Web site and available in both Visual PRO/5 and BBj versions. The demo has three programs. The first is the loader program, startsocket.bbx (or .bbj). This program uses asynchronous SCALLs to start a socket server, tcpsocketg.bbx (.bbj), and the socket client, tcpclientg.bbx (.bbj). The client program displays radio buttons that allow the user to choose among several applications that the server could run. These applications are Windows Notepad, Windows Explorer, Visual PRO/5, BBj or the BASIS Chile Company Master File Maintenance program. When the user clicks on a radio button, a one-letter command, N, E, V or F, is sent to the server program, which launches the appropriate application via an asynchronous SCALL. Take a look at these programs. They could open your eyes, and your software, into new horizons.

Download our socket demonstration program at: