> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFLobbyGetServerConnectionStatus

> PFLobbyGetServerConnectionStatus reference for querying the lobby server's connection state to the notification service in the PlayFab Multiplayer C++ SDK.

Retrieves the lobby server's connection status to the notification service.

## Syntax

```cpp theme={null}
HRESULT PFLobbyGetServerConnectionStatus(  
    PFLobbyHandle lobby,  
    PFLobbyServerConnectionStatus* connectionStatus  
)  
```

### Parameters

**`lobby`**   PFLobbyHandle

The handle of the lobby.

**`connectionStatus`**   [PFLobbyServerConnectionStatus\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/enums/pflobbyserverconnectionstatus)\
*output*

The output connection status of the server.

### Return value

Type: HRESULT

`S_OK` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PFMultiplayerGetErrorMessage()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

## Remarks

When joining a lobby, the library establishes a WebSocket connection to the PlayFab PubSub notification service. This connection is used to provide real-time updates to the library about the lobby. This method can be used to determine the lobby server's connection status, which is useful for diagnosing the lobby server's ability to receive updates about the lobby. <br /><br /> Non-owning Lobby servers can only join client-owned lobbies. If no server is joined to the client-owned lobby, this method returns an appropriate error code.   <br /><br /> A lobby server, which is still in the process of asynchronously joining the lobby, via a call to [PFMultiplayerJoinLobbyAsServer()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerjoinlobbyasserver) sees its connection status as [PFLobbyServerConnectionStatus::NotConnected](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/enums/pflobbyserverconnectionstatus) until the connection is established.   <br /><br /> A change to a lobby server's connection status is indicated to the title via a [PFLobbyUpdatedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange) with the `PFLobbyUpdatedStateChange::serverConnectionStatusUpdated` field set to true.

## Requirements

**Header:** PFLobby.h

## See also

[PFLobby members](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members)


## Related topics

- [PlayFab Multiplayer C++ SDK Release Notes](/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
- [PFMultiplayer C/C++ API overview - PFLobby.h](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)
- [Lobby.GetServerConnectionStatus](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/GetServerConnectionStatus.md)
- [LobbyServerConnectionStatus](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyServerConnectionStatus.md)
- [PFLobbyServerConnectionStatus](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/enums/pflobbyserverconnectionstatus.md)
