GameLiftStreams / Client / create_stream_session_connection
create_stream_session_connection#
- GameLiftStreams.Client.create_stream_session_connection(**kwargs)#
Allows clients to reconnect to a recently disconnected stream session without losing any data from the last session.
A client can reconnect to a stream session that’s in
PENDING_CLIENT_RECONNECTION
orACTIVE
status. In the stream session life cycle, when the client disconnects from the stream session, the stream session transitions fromCONNECTED
toPENDING_CLIENT_RECONNECTION
status. When a client requests to reconnect by callingCreateStreamSessionConnection
, the stream session transitions toRECONNECTING
status. When the reconnection is successful, the stream session transitions toACTIVE
status. After a stream session is disconnected for longer thanConnectionTimeoutSeconds
, the stream session transitions to theTERMINATED
status.To connect to an existing stream session, specify the stream group ID and stream session ID that you want to reconnect to, as well as the signal request settings to use with the stream.
ConnectionTimeoutSeconds
defines the amount of time after the stream session disconnects that a reconnection is allowed. If a client is disconnected from the stream for longer thanConnectionTimeoutSeconds
, the stream session ends.See also: AWS API Documentation
Request Syntax
response = client.create_stream_session_connection( ClientToken='string', Identifier='string', SignalRequest='string', StreamSessionIdentifier='string' )
- Parameters:
ClientToken (string) –
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.
This field is autopopulated if not provided.
Identifier (string) –
[REQUIRED]
Amazon Resource Name (ARN) or ID that uniquely identifies the stream group resource. Format example: ARN-
arn:aws:gameliftstreams:us-west-2:123456789012:streamgroup/1AB2C3De4
or ID-1AB2C3De4
.The stream group that you want to run this stream session with. The stream group must be in
ACTIVE
status and have idle stream capacity.SignalRequest (string) –
[REQUIRED]
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
.StreamSessionIdentifier (string) –
[REQUIRED]
Amazon Resource Name (ARN) that uniquely identifies the stream session resource. Format example:
1AB2C3De4
. The stream session must be inPENDING_CLIENT_RECONNECTION
orACTIVE
status.
- Return type:
dict
- Returns:
Response Syntax
{ 'SignalResponse': 'string' }
Response Structure
(dict) –
SignalResponse (string) –
The WebRTC answer string that the stream server generates in response to the
SignalRequest
.
Exceptions