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
messagestringThe 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
messagestringThe message that describes the error.
errorKindSteamNetworkErrorKindThe broad reason the operation failed.
operationstringThe API operation or lifecycle step that failed.
targetIdCSteamID?The Steam ID of the target peer associated with the operation, if available.
channelint?The communication channel associated with the operation, if available.
messageTypestringThe message type associated with the operation, if available.
packetSizeint?The packet size in bytes associated with the operation, if available.
maxPacketSizeint?The maximum allowed packet size in bytes, if available.
sessionErrorEP2PSessionError?The P2P session error associated with the operation, if available.
isRetryableboolTrue 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
messagestringThe message that describes the error.
targetIdCSteamIDThe 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
messagestringThe message that describes the error.
targetIdCSteamIDThe Steam ID of the target peer associated with the operation.
sessionErrorEP2PSessionErrorThe 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
messagestringThe message that describes the error.
targetIdCSteamIDThe Steam ID of the target peer associated with the operation.
channelintThe 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
messagestringThe message that describes the error.
sessionErrorEP2PSessionErrorThe 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
messagestringThe error message that explains the reason for the exception.
innerExceptionThe 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
messagestringThe message that describes the error.
innerExceptionThe exception that caused the current exception.
errorKindSteamNetworkErrorKindThe broad reason the operation failed.
operationstringThe API operation or lifecycle step that failed.
targetIdCSteamID?The Steam ID of the target peer associated with the operation, if available.
channelint?The communication channel associated with the operation, if available.
messageTypestringThe message type associated with the operation, if available.
packetSizeint?The packet size in bytes associated with the operation, if available.
maxPacketSizeint?The maximum allowed packet size in bytes, if available.
sessionErrorEP2PSessionError?The P2P session error associated with the operation, if available.
isRetryableboolTrue when retrying later may succeed; otherwise, false.
Properties
Channel
Gets the communication channel associated with the P2P operation.
public int Channel { get; }
Property Value
HasChannel
Gets a value indicating whether Channel was provided for the failed operation.
public bool HasChannel { get; }
Property Value
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
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; }