Welcome to the Dart White Paper repository. We have created this section to publish White Papers about our technology, ideas for IT solutions implementing TCP and UDP based communications, tips for using our products, and opinions about current and coming technologies. Along with these articles, readers will have the opportunity to respond with their own ideas and we will publish those comments along with the articles. If you have a comment on any article, please submit it to comments@dart.com.

PowerTCP 4.0
February 2009

The latest version of the venerable PowerTCP product line gets a new redesign that leverages the power of the latest .NET frameworks to bring our customers the most advanced Internet Communications components available.  These new updates are not incremental improvements to the product.  They are ground-up redesigns that leverage both Dart's extensive communications component experience as well as feedback from hundred of customers.  With PowerTCP 4, developers will get the benefits of:

  • Improved and Simplified Asynchronous Operations
  • Improved Support for Framework 2.0+ Features
  • Compact Framework Support
  • Integrated Security

Background (pre .NET)

The Visual Basic environment brought us the capability to use components (VBX’s and OCX’s), but typically only executed on the UI thread. While multi-threaded support was being added at the OS level, developers needed C++ to create multi-threaded applications.

PowerTCP started using background worker threads when Visual Basic started supporting 32-bit applications. In this mode, PowerTCP executed communication tasks on embedded worker threads to keep from interfering with the UI. However, events could only be raised on the UI thread.

.NET 1.x

The convenient use of worker threads, delegates and events was greatly improved under .NET 1:

  • Background threads could be conveniently started
  • Events could be raised on worker threads
  • In fact, the multi-threaded environment became so powerful that users needed to become aware of concepts like thread safety and synchronization, which was never of concern before.

PowerTCP evolved also, providing an interface that included blocking methods (which block the executing thread until completion), pseudo-blocking methods (which block the UI thread until completion, but processes events while doing so), and asynchronous methods (which execute on background threads). Our task was to provide as complete an interface as possible without making it complex or difficult to use.

.NET 2.0+

The .NET environment evolved again, and developers have kept pace. We are finding that our customers are developing more applications for ASP.NET, more console applications, and more Windows Services. These environments don’t have a UI thread, so pseudo-blocking and asynchronous methods are not relevant for these applications. We are also seeing trends towards greater levels of customer control. For these reasons we set out to design PowerTCP 4, with the following design emphases:

Improved Asynchronous Support

Our traditional asynchronous support provided a way to start and complete background threads, but this involved stringing together a series of operations, each called when the previous completed. This resulted in some difficult-to-maintain, event-driven code. We looked for a better mechanism, one that was self-documenting and thus easier to maintain, used fewer resources, and was more flexible to use. The result is an architecture and set of interfaces that make it simple to initiate asynchronous operations while retaining the readability of blocking, synchronous code.  The following code snippit illustrates the new design using our new Telnet control:

........private void Form1_Load(object sender, EventArgs e)
        {
            // start the Worker method on a worker thread
            telnet1.Start(Worker, null);
        }

        void Worker(Telnet telnet, object state)
        {
            // this executes on a worker thread, protecting the UI thread
            telnet.Connect("myServer");
            telnet.Login("username", "password", "$");
            telnet.Write(Encoding.Default.GetBytes("ls -l\r\n"));
            // marshal the listing back to the UI thread
            telnet.Marshal(telnet.Read(new buffer[10000]));
            telnet.Close();
        }
 
        private void telnet1_Data(object sender, DataEventArgs e)
        {
            // now on the UI thread, we can put the listing into the textBox
            textBox1.Text = e.Data.ToString();
        }

Note that we have provided a convenient Start() method that allows the user to string together multiple blocking methods which provides the following benefits:

  • The code is less event-driven.  Methods are called in-line, producing self-documenting code that is easier to write and maintain.
  • Marshal() methods are included, that allow the user to conveniently marshal data back to the UI thread for display in any UI control
  • The PowerTCP interface has been greatly simplified and made more efficient
    • No single-purpose asynchronous methods are necessary.  The simple Start() methods allows users to conveniently and directly execute on a worker thread.
    • No pseudo-blocking functionality is necessary, eliminating problems associated with unexpected reentrancy, caused when UI messages are processed while a communication method is in progress.
    • A single worker thread can be used to string together any combination of blocking methods, allowing the user to execute any combination of methods without using multiple worker threads in serial, often used by less advanced designs. This approach minimizes the overhead created by starting multiple operation-specific threads.

Improved Support for .NET 2.0+ Features

The .NET 2.0 Framework provided generics, improved support for X509 certificates, and other features that PowerTCP 4 takes advantage of. Now that most of our customers have migrated from .NET 1.x, we are steadily upgrading each PowerTCP product without sacrificing backward compatibility. Of course, for customers still working with Framework 1.x or in mixed environments, our current products will still be licensed for use in the .NET 1.x environment to support legacy applications.

Support for .NET Compact Framework

With this re-design, Dart is rapidly extending comprehensive support to the Compact Framework.  Mobile platform development is a rapidly growing field, and with PowerTCP 4 Dart will be offering its leading components for use in this environment.

Integrated Security

Secure Socket Layer (SSL) security is being integrated into the core libraries, so that SSL encryption will be included in each new product. 

Release Plans

Throughout 2009, new products and product updates will be rolled out.  Our first release will be PowerTCP Telnet for .NET with PowerTCP Telnet for .NET CF soon after.  Subscription holders will receive PowerTCP 4 versions of any products released within the period of their subscriptions.