Abstract Class Transport

Introduction

This class represents a serial transport mechanism. Its primary reason for existing is to provide an abstraction above Socket for use by the Telnet class, since the telnet protocol does not strictly require sockets as its transport mechanism. For instance, it is theoretically possible to conduct a Telnet session over HTTP, a pipe, or even smoke signals -- provided an encoding of characters 0-255.

This abstract class only provides two methods, Send and Receive. We do not presume characteristics of the relationship between the sender and the receiver such as client/server, peer-to-peer, out/in process, or threading. It is expected that derived classes will add members to establish connections and control options.

Contents

  1. Introduction
  2. Contents
  3. Explanation of symbols used
  4. Member reference
    1. Receive - Receive text from a sender
    2. Send - Send text to a receiver

Explanation of symbols used

Words in italics indicate an instance of a class. The word corresponds to the class name, except where more than one instance is represented in the same statement. In that case a number (2, 3, etc.) is appended to the class name.

Words in normal typeface are to be taken literally (required punctuation, class name in a static reference, method name, etc.)

The symbol => is used to separate an expression (on the left) from its return value (on the right).

An ellipsis (...) indicates that the previous argument may be repeated any number of times. The description will indicate whether one instance is required.

Member reference

abstract method Receive

transport.Receive(a) => i
This method receives data from a sender on the other end of the connection, returning that data in the parameter a, which must be writable. It is expected that the data will be limited to the size of a. The method returns the number of characters returned in a.

abstract method Send

transport.Send(a) => boolean
This method sends the characters in a to the receiver on the other end of the connection. It returns true if successful, or false to indicate a failure. There is no presumption that the receiver has actually received the data yet, merely that the send did not fail.