create_stream_session_connection
async
¶
create_stream_session_connection(
identifier: Identifier,
stream_session_identifier: Identifier,
signal_request: SignalRequest,
*,
config_overrides: Optional[AsyncGameLiftStreamsClientConfig] = None,
client_token: Optional[ClientToken] = None,
) -> CreateStreamSessionConnectionOutput
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
CONNECTEDtoPENDING_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
RECONNECTINGstatus
-
-
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.
Parameters:
-
client_token(Optional[ClientToken], default:None) –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.
-
identifier(Identifier) –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
ACTIVEstatus. -
stream_session_identifier(Identifier) –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_RECONNECTIONorACTIVEstatus. -
signal_request(SignalRequest) –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.
Raises:
-
AccessDeniedException–You don't have the required permissions to access this Amazon GameLift Streams resource. Correct the permissions before you try again.
-
ConflictException–The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.
-
InternalServerException–The service encountered an internal error and is unable to complete the request.
-
ResourceNotFoundException–The resource specified in the request was not found. Correct the request before you try again.
-
ThrottlingException–The request was denied due to request throttling. Retry the request after the suggested wait time.
-
ValidationException–One or more parameter values in the request fail to satisfy the specified constraints. Correct the invalid parameter values before retrying the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_gameliftstreams/_services/async_game_lift_streams.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | |