Table of Contents

Class P2PException

Namespace
SteamNetworkLib.Exceptions
Assembly
SteamNetworkLib.dll

Exception thrown when peer-to-peer (P2P) communication operations fail. Provides additional context about Steam P2P operations including target IDs, session errors, and channels.

public class P2PException : SteamNetworkException, ISerializable
Inheritance
P2PException
Implements
Inherited Members

Constructors

P2PException()

Initializes a new instance of the P2PException class.

public P2PException()

P2PException(string)

Initializes a new instance of the P2PException class with a specified error message.

public P2PException(string message)

Parameters

message string

The message that describes the error.

P2PException(string, SteamNetworkErrorKind, string?, CSteamID??, int?, string?, int?, int?, EP2PSessionError??, bool)

Initializes a new instance of the P2PException class with structured diagnostic details.

public P2PException(string message, SteamNetworkErrorKind errorKind, string? operation = null, CSteamID?? targetId = null, int? channel = null, string? messageType = null, int? packetSize = null, int? maxPacketSize = null, EP2PSessionError?? sessionError = null, bool isRetryable = false)

Parameters

message string

The message that describes the error.

errorKind SteamNetworkErrorKind

The broad reason the operation failed.

operation string

The API operation or lifecycle step that failed.

targetId CSteamID?

The Steam ID of the target peer associated with the operation, if available.

channel int?

The communication channel associated with the operation, if available.

messageType string

The message type associated with the operation, if available.

packetSize int?

The packet size in bytes associated with the operation, if available.

maxPacketSize int?

The maximum allowed packet size in bytes, if available.

sessionError EP2PSessionError?

The P2P session error associated with the operation, if available.

isRetryable bool

True when retrying later may succeed; otherwise, false.

P2PException(string, CSteamID)

Initializes a new instance of the P2PException class with a specified error message and target peer ID.

public P2PException(string message, CSteamID targetId)

Parameters

message string

The message that describes the error.

targetId CSteamID

The Steam ID of the target peer associated with the operation.

P2PException(string, CSteamID, EP2PSessionError)

Initializes a new instance of the P2PException class with a specified error message, target peer ID, and session error.

public P2PException(string message, CSteamID targetId, EP2PSessionError sessionError)

Parameters

message string

The message that describes the error.

targetId CSteamID

The Steam ID of the target peer associated with the operation.

sessionError EP2PSessionError

The P2P session error that occurred during the operation.

P2PException(string, CSteamID, int)

Initializes a new instance of the P2PException class with a specified error message, target peer ID, and channel.

public P2PException(string message, CSteamID targetId, int channel)

Parameters

message string

The message that describes the error.

targetId CSteamID

The Steam ID of the target peer associated with the operation.

channel int

The communication channel associated with the P2P operation.

P2PException(string, EP2PSessionError)

Initializes a new instance of the P2PException class with a specified error message and session error.

public P2PException(string message, EP2PSessionError sessionError)

Parameters

message string

The message that describes the error.

sessionError EP2PSessionError

The P2P session error that occurred during the operation.

P2PException(string, Exception)

Initializes a new instance of the P2PException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public P2PException(string message, Exception inner)

Parameters

message string

The error message that explains the reason for the exception.

inner Exception

The exception that is the cause of the current exception, or a null reference if no inner exception is specified.

P2PException(string, Exception, SteamNetworkErrorKind, string?, CSteamID?, int?, string?, int?, int?, EP2PSessionError?, bool)

Initializes a new instance of the P2PException class with structured diagnostic details and an inner exception.

public P2PException(string message, Exception inner, SteamNetworkErrorKind errorKind, string? operation = null, CSteamID? targetId = null, int? channel = null, string? messageType = null, int? packetSize = null, int? maxPacketSize = null, EP2PSessionError? sessionError = null, bool isRetryable = false)

Parameters

message string

The message that describes the error.

inner Exception

The exception that caused the current exception.

errorKind SteamNetworkErrorKind

The broad reason the operation failed.

operation string

The API operation or lifecycle step that failed.

targetId CSteamID?

The Steam ID of the target peer associated with the operation, if available.

channel int?

The communication channel associated with the operation, if available.

messageType string

The message type associated with the operation, if available.

packetSize int?

The packet size in bytes associated with the operation, if available.

maxPacketSize int?

The maximum allowed packet size in bytes, if available.

sessionError EP2PSessionError?

The P2P session error associated with the operation, if available.

isRetryable bool

True when retrying later may succeed; otherwise, false.

Properties

Channel

Gets the communication channel associated with the P2P operation.

public int Channel { get; }

Property Value

int

HasChannel

Gets a value indicating whether Channel was provided for the failed operation.

public bool HasChannel { get; }

Property Value

bool

MaxPacketSize

Gets the maximum allowed packet size in bytes, if available.

public int? MaxPacketSize { get; }

Property Value

int?

MessageType

Gets the message type associated with the failed operation, if available.

public string? MessageType { get; }

Property Value

string

PacketSize

Gets the packet size in bytes associated with the failed operation, if available.

public int? PacketSize { get; }

Property Value

int?

SessionError

Gets the P2P session error that occurred during the operation, if available.

public EP2PSessionError? SessionError { get; }

Property Value

EP2PSessionError?

TargetId

Gets the Steam ID of the target peer associated with the P2P operation, if available.

public CSteamID? TargetId { get; }

Property Value

CSteamID?

TargetId64

Gets the target peer Steam ID as a 64-bit integer, or 0 when no target ID is available.

public ulong TargetId64 { get; }

Property Value

ulong