2.1.1.1.1 Sending Request

In the client role, an implementation MUST first establish a TCP connection to the server. A client implementation MAY cache and reuse a connection to a specific server port or create a new connection.<2>

After a connection is established, a client implementation MUST transmit the message content that contains information to perform invocation of the target Remote Method identified by the higher layer as specified in Remote Method Invocation.

The implementation MUST construct a message frame structure as specified in Message Frame Structure with the following additional constraints:

  • The implementation SHOULD use single message content (section 2.2.3.3.1) but MAY use chunked message content (section 2.2.3.3.2).<3>

  • The implementation MUST set the OperationType field of the message frame to OneWayRequest(1) if the Remote Method is a One-Way Method; otherwise, the field MUST be set to Request(0).

  • The implementation MUST send a request message that consists of the message frame and the message content using the previously established TCP connection. The message content MUST be sent as specified in Message Frame Structure. If any error occurs while the message is being written, the implementation MAY reestablish the connection and retransmit the message.

  • If the Remote Method is One-Way then the connection MAY be reused after the message has been sent. If the Remote Method is Two-Way then the connection MUST NOT be used to send any other requests to the server until the response for the request is received.<4>