ISteamNetworkingSockets.CloseConnection

Disconnects from the remote host and invalidates the connection handle. Any unread data on the connection is discarded.

nReason is an application defined code that will be received on the other end and recorded (when possible) in backend analytics. The value should come from a restricted range. (See ESteamNetConnectionEnd.) If you don't need to communicate any information to the remote host, and do not want analytics to be able to distinguish "normal" connection terminations from "exceptional" ones, You may pass zero, in which case the generic value of k_ESteamNetConnectionEnd_App_Generic will be used.

pszDebug is an optional human-readable diagnostic string that will be received by the remote host and recorded (when possible) in backend analytics.

If you wish to put the socket into a "linger" state, where an attempt is made to flush any remaining sent data, use bEnableLinger=true. Otherwise reliable data is not flushed.

If the connection has already ended and you are just freeing up the connection interface, the reason code, debug string, and linger flag are ignored.

class ISteamNetworkingSockets
bool
CloseConnection

Meta