/AWS1/IF_GMZ=>CREATESTREAMSESSIONCONN()
¶
About CreateStreamSessionConnection¶
Enables clients to reconnect to a stream session while preserving all session state and data in the disconnected session. This reconnection process can be initiated when a stream session is in either PENDING_CLIENT_RECONNECTION
or ACTIVE
status. The process works as follows:
-
Initial disconnect:
-
When a client disconnects or loses connection, the stream session transitions from
CONNECTED
toPENDING_CLIENT_RECONNECTION
-
-
Reconnection time window:
-
Clients have
ConnectionTimeoutSeconds
(defined in StartStreamSession) to reconnect before session termination -
Your backend server must call CreateStreamSessionConnection to initiate reconnection
-
Session transitions to
RECONNECTING
status
-
-
Reconnection completion:
-
On successful CreateStreamSessionConnection, session status changes to
ACTIVE
-
Provide the new connection information to the requesting client
-
Client must establish connection within
ConnectionTimeoutSeconds
-
Session terminates automatically if client fails to connect in time
-
For more information about the stream session lifecycle, see Stream sessions in the Amazon GameLift Streams Developer Guide.
To begin re-connecting to an existing stream session, specify the stream group ID and stream session ID that you want to reconnect to, and the signal request to use with the stream.
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_identifier
TYPE /AWS1/GMZIDENTIFIER
/AWS1/GMZIDENTIFIER
¶
Amazon Resource Name (ARN) or ID that uniquely identifies the stream group resource. Example ARN:
arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4
. Example ID:sg-1AB2C3De4
.The stream group that you want to run this stream session with. The stream group must be in
ACTIVE
status.
iv_streamsessionidentifier
TYPE /AWS1/GMZIDENTIFIER
/AWS1/GMZIDENTIFIER
¶
Amazon Resource Name (ARN) or ID that uniquely identifies the stream session resource. Example ARN:
arn:aws:gameliftstreams:us-west-2:111122223333:streamsession/sg-1AB2C3De4/ABC123def4567
. Example ID:ABC123def4567
.The stream session must be in
PENDING_CLIENT_RECONNECTION
orACTIVE
status.
iv_signalrequest
TYPE /AWS1/GMZSIGNALREQUEST
/AWS1/GMZSIGNALREQUEST
¶
A WebRTC ICE offer string to use when initializing a WebRTC connection. The offer is a very long JSON string. Provide the string as a text value in quotes. The offer must be newly generated, not the same offer provided to
StartStreamSession
.
Optional arguments:¶
iv_clienttoken
TYPE /AWS1/GMZCLIENTTOKEN
/AWS1/GMZCLIENTTOKEN
¶
A unique identifier that represents a client request. The request is idempotent, which ensures that an API request completes only once. When users send a request, Amazon GameLift Streams automatically populates this field.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_gmzcrestrmsessconnout
/AWS1/CL_GMZCRESTRMSESSCONNOUT
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->/aws1/if_gmz~createstreamsessionconn(
iv_clienttoken = |string|
iv_identifier = |string|
iv_signalrequest = |string|
iv_streamsessionidentifier = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_signalresponse = lo_result->get_signalresponse( ).
ENDIF.