up previous next
OpenSocket

open a socket connection
Syntax

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


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
MEMORY.CoCoAServerMachine := "localhost";
MEMORY.CoCoAServerPort := "0xc0c0";


Example
D := OpenSocket("localhost", "10000");
Print 100^6 On D;
Source D;
Close(D);


See Also