Cold Help System: Programming: ColdC Reference Manual: Implementation: Networking: Client Connection


To establish a client connection call the function open_connection() with the first argument as a STRING specifing the IP address of the host, and the second argument an INTEGER specifying the network port to connect on. This function is not a blocking function. Calling it will simply start the process of opening a connection. If there are no immediate errors the function will return normally.

When a connection is opened the driver will call the method .connect() on the current object, with the argument being an INTEGER task_id for the task which called open_connection(). Connection code may wish to suspend() after calling open_connection(), then have the method .connect() resume the task when it is received.

If the connection could not be established, the method .failed() is called instead. The first argument is once again the task id, the second argument is an ERROR representing why the connection could not be established.

Once the connection is established, input and output is handled the same as on a server connection.


Server Connection | Client Connection | Driver Network Methods


the Cold Dark