|Home > Generic function call interface > IrisRpc (RPC transport layer) > IrisRpc connection handshake|
Clients use the IrisRpc protocol to initiate a connection to an Iris server, for example the IrisTcpServer that is running in the simulation.
The IrisRpc connection handshake allows the client to do the following:
It also allows the server to notify the client whether it supports the requested IrisRpc version.
For a TCP connection, it is assumed that the client knows the host IP and port number of the TCP server.
The following procedure is used to establish a connection:
The client sends the following request to connect using IrisRpc version 1.0:
CONNECT / IrisRpc/1.0<CR><LF> Supported-Formats: IrisJson, IrisU64Json, JsonRpcOverHttp<CR><LF> <CR><LF>
The server sends the following response to tell the client that the connection is established, the protocol is IrisRpc/1.0, and a list of supported message formats:
IrisRpc/1.0 200 OK<CR><LF> Supported-Formats: IrisJson, IrisU64Json, JsonRpcOverHttp<CR><LF> <CR><LF>
After this step, the client and server can send and receive IrisRpc messages.
At this point, all client instances, but usually just one, should call
instanceRegistry_registerInstance() to register
themselves in the instance registry. Other instances can then discover them
and query their properties and name.
The start lines and the header fields must be formatted according to RFC 7230, Section 3, HTTP/1.1 Message Format. The client and the server must ignore any header fields they do not understand.