TCPConnectionGetStatusReport
Full Description
swirl
Syntax
  define external function TCPConnectionGetStatusReport
        value TCPConnection this-TCPConnection
     into modifiable stream report
  as TCPConnectionGetStatusReport


Purpose

This function is used to identify an error message, should the TCP connection object be in error.

If the TCP connection is in error, the "into" shelf is populated with one or more strings, each an appropriate error message. Any previous shelf contents are lost. In most cases, there will be only one error to report.

If the TCP connection is not in error, the shelf will be cleared. Errors in initiating or using a TCP connection are recorded in the TCP connection itself. TCPServiceGetStatusReport is used to identify the error.

Each error entry in the shelf consists of a symbolic (string) error code, followed by a single space, followed by text that describes or explains the error in more detail. A list of symbolic constants along with their meanings are described below:

  • ENETDOWN: "Network subsystem failed"
  • EMFILE: "No file handles available"
  • ENOBUFS: "No buffer space available"
  • ENOSOCK: "Handle is not a socket"
  • ENOTCONN: "Not connected"
  • EADDRNOTAVAIL: "Address not available"
  • ECONNABORTED: "Connection aborted"
  • ECONNRESET: "Connection reset"
  • ETIMEDOUT: "Connection timed out"
  • ECONNREFUSED: "Connection refused"
  • EREAD : "Failed to read from connection"
  • EWRITE: "Failed to write to connection"
  • EHOSTDOWN: "Host down"
  • EHOSTUNREACH: "Host unreachable"
  • HOST_NOT_FOUND: "Authoritive: Host not found"
  • TRY_AGAIN: "Non-authoritive: host not found or server failure"
  • NO_RECOVERY: "Non-authoritive: refused or not implemented"
  • EINTERNAL: "Internal error"

Arguments:

  • "this-TCPConnection" is an opaque object of type TCPConnection.
  • "report" is a stream shelf in which the error messages are stored. It must be of variable size.

Example:

  local TCPConnection client

  set client to TCPConnectionOpen on "123.123.123.45" at 5600
  do when TCPConnectionIsInError client
     local stream errorReport variable

     TCPConnectionGetStatusReport client into errorReport
     output "tcp Connection Error:%N"
     repeat over errorReport
        output errorReport || "%n"
     again
  done

Copyright © OmniMark Technologies Corporation, 1988-1998.