mirror of
https://github.com/ValveSoftware/GameNetworkingSockets.git
synced 2026-05-29 16:20:34 +00:00
API to atomically set initial options.
Added a mechanism to set initial options when creating a listen socket or connection.
This commit is contained in:
@@ -240,7 +240,7 @@ public:
|
||||
SteamNetworkingIPAddr serverLocalAddr;
|
||||
serverLocalAddr.Clear();
|
||||
serverLocalAddr.m_port = nPort;
|
||||
m_hListenSock = m_pInterface->CreateListenSocketIP( serverLocalAddr );
|
||||
m_hListenSock = m_pInterface->CreateListenSocketIP( serverLocalAddr, 0, nullptr );
|
||||
if ( m_hListenSock == k_HSteamListenSocket_Invalid )
|
||||
FatalError( "Failed to listen on port %d", nPort );
|
||||
Printf( "Server listening on port %d\n", nPort );
|
||||
@@ -533,7 +533,7 @@ public:
|
||||
char szAddr[ SteamNetworkingIPAddr::k_cchMaxString ];
|
||||
serverAddr.ToString( szAddr, sizeof(szAddr), true );
|
||||
Printf( "Connecting to chat server at %s", szAddr );
|
||||
m_hConnection = m_pInterface->ConnectByIPAddress( serverAddr );
|
||||
m_hConnection = m_pInterface->ConnectByIPAddress( serverAddr, 0, nullptr );
|
||||
if ( m_hConnection == k_HSteamNetConnection_Invalid )
|
||||
FatalError( "Failed to create connection" );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user