Update C# bindings to 1.4.0 API

This commit is contained in:
Joseph Henry
2021-04-30 21:54:34 -07:00
parent 3e304cb25a
commit 6f42338f6e
19 changed files with 4679 additions and 3143 deletions

44
src/bindings/csharp/SocketException.cs Normal file → Executable file
View File

@@ -4,7 +4,7 @@
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file in the project's root directory.
*
* Change Date: 2025-01-01
* Change Date: 2026-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2.0 of the Apache License.
@@ -15,24 +15,26 @@ using System;
namespace ZeroTier.Sockets
{
/// <summary>Exception class for ZeroTier service and low-level socket errors</summary>
public class SocketException : Exception
{
public SocketException(int _serviceErrorCode)
: base(String.Format("ServiceErrorCode={0} (See Constants.cs for error code meanings)", _serviceErrorCode))
{
ServiceErrorCode = _serviceErrorCode;
}
public SocketException(int _serviceErrorCode, int _socketErrorCode)
: base(String.Format("ServiceErrorCode={0}, SocketErrorCode={1} (See Constants.cs for error code meanings)", _serviceErrorCode, _socketErrorCode))
{
ServiceErrorCode = _serviceErrorCode;
SocketErrorCode = _socketErrorCode;
}
/// <value>High-level service error code. See Constants.cs</value>
public int ServiceErrorCode { get; private set; }
/// <summary>Exception class for ZeroTier service and low-level socket errors</summary>
public class SocketException : Exception {
public SocketException(int _serviceErrorCode)
: base(String.Format("ServiceErrorCode={0} (See Constants.cs for error code meanings)", _serviceErrorCode))
{
ServiceErrorCode = _serviceErrorCode;
}
public SocketException(int _serviceErrorCode, int _socketErrorCode)
: base(String.Format(
"ServiceErrorCode={0}, SocketErrorCode={1} (See Constants.cs for error code meanings)",
_serviceErrorCode,
_socketErrorCode))
{
ServiceErrorCode = _serviceErrorCode;
SocketErrorCode = _socketErrorCode;
}
/// <value>High-level service error code. See Constants.cs</value>
public int ServiceErrorCode { get; private set; }
/// <value>Low-level socket error code. See Constants.cs</value>
public int SocketErrorCode { get; private set; }
}
}
/// <value>Low-level socket error code. See Constants.cs</value>
public int SocketErrorCode { get; private set; }
}
}