CoCoA:OpenSocket

From ApCoCoAWiki

OpenSocket

open a socket connection

Description

This function opens a client socket (I/O) connection.

It requires the name of the machine with the server socket and the

port number (expressed as a STRING).

CoCoA-4 communicates with the CoCoAServer via socket which, by

default, runs on localhost on

port "0xc0c0". To change these settings redefine in your userinit.coc or .cocoarc the variables <verbatim> MEMORY.CoCoAServerMachine := "localhost"; MEMORY.CoCoAServerPort := "0xc0c0"; </verbatim>

Example

  D := OpenSocket(<quotes>localhost</quotes>, <quotes>10000</quotes>);
  Print 100^6 On D;
  Source D;
  Close(D);

Syntax

OpenSocket(Machine: STRING, Port: STRING): DEVICE

Introduction to IO

OpenIFile

OpenOFile

OpenIString

OpenOString

Unset

   <type>io</type>
   <type>printing</type>