1.2.2. Making a connection to the server

This section contains the following sections:

Opening a TCP connection

For a client to communicate with a server, TAPOp_RPC_Initialise must be called to open a connection to the transport layer (TCP). The server location is identified by a callback function GetServerName that the client must supply. This opens a two-way channel between the client and server through which procedure calls can be made to the server.

More than one TCP connection to the server can be opened at the same time from the same client. The standard distribution of rpcclient.c opens three TCP connections by default and two of these can be used to overlap RPC calls to improve performance. This is done in the Multi-ICE DLL during downloads where multiple threads are used to pipeline RPC calls. When the client has finished, the TCP connection is closed using TAPOp_RPC_Finalise.

Opening a TAPOp connection

After a TCP connection has been made to a Multi-ICE server, the client must indicate to the server which device to use. This is known as opening a TAPOp connection, and at any one time there is a single connection between the client and a single device on the server. The TAPOp connection is identified by a connection Identifier (ID) that is used in all subsequent calls to the server. The client must close this connection when finishing a debug session.

The connection ID is a logical identifier that the server uses to recognize which client it is talking to, and it identifies a particular device on a particular TAP controller. It is allocated by the server when the client makes a TAPOp_OpenConnection call to the server.

At the same time, another TAPOp connection can be present to another device, even on the same TAP controller, using a different connection ID, but a single device can only be connected to a single connection ID. For example, if the client opens three connections to the same device, calls from the client on any of the TCP connections must use the same TAPOp connection ID.

Closing a TAPOp connection

To close the TAPOp connection, call TAPOp_CloseConnection. All the macros defined by the client are deleted and storage is freed.

Copyright © 1998-2002 ARM Limited. All rights reserved.ARM DUI 0154B