swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

tcp.put-string

 
 

Library: Net, TCP/IP client and server support (OMTCP)
Import: omtcp.xmd

Declaration

  define external function tcp.put-string
    to      value tcp.connection Connection
    from    value stream         characters
    timeout value integer        ms 	    optional

Argument definitions

Connection
is a tcp.connection object representing an existing connection.
characters
are the characters that will be put in the output stream.
ms
is how long the function will wait for at least one character to be written, expressed in milliseconds.


Purpose

Use tcp.put-string to write characters to a TCP connection (sending them to the receiver).

Requirements

Connection must exist (else external exception TCP05).

There may not be an active external sink derived from Connection with tcp.writer (else external exception TCP20).

Usage Notes

If an error occurs while writing, external exception TCP12 is thrown.

If the write operation times out, external exception TCP06 is thrown.

Sequential uses of tcp.put-string is allowed.

Example


  import "omtcp.xmd" prefixed by tcp.
  process
     local tcp.connection Connection-1

     set Connection-1 to tcp.connect to "localhost" on 5300

     tcp.put-string to Connection-1 from "hello world"
     tcp.put-string to Connection-1 from ((("*" ||* 78) || "%n") ||* 40)

    Related Syntax
   tcp.connection
   tcp.disconnect
   tcp.writer
   tcp.get-string
   tcp.peer-ip
   tcp.peer-name
   tcp.reader
   tcp.wait-for-input
   tcp.is-connected
   tcp.connect
   tcp.set-buffering
   tcp.terminate-reader
 
  Other Library Functions
   tcp.accept-connection
   tcp.connect
   tcp.connection
   tcp.create-service
   tcp.destroy-service
   tcp.disconnect
   tcp.end-delimited
   tcp.get-string
   tcp.is-connected
   tcp.multi-packet
   tcp.omtcp-version
   tcp.peer-ip
   tcp.peer-name
   tcp.port
   tcp.put-string
   tcp.reader
   tcp.service
   tcp.set-buffering
   tcp.single-packet
   tcp.terminate-reader
   tcp.wait-for-input
   tcp.writer
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:50 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.