fix(Transports): Suppress obsolete warnings

This commit is contained in:
MrGadget 2024-07-20 13:05:53 -04:00
parent 86d8bc912c
commit 1968ef9f9b
4 changed files with 8 additions and 0 deletions

View File

@ -208,7 +208,9 @@ public override void ServerStart()
{
_credentials = EncryptionCredentials.Generate();
}
#pragma warning disable CS0618 // Type or member is obsolete
inner.OnServerConnected = HandleInnerServerConnected;
#pragma warning restore CS0618 // Type or member is obsolete
inner.OnServerConnectedWithAddress = HandleInnerServerConnected;
inner.OnServerDataReceived = HandleInnerServerDataReceived;
inner.OnServerDataSent = (connId, bytes, channel) => OnServerDataSent?.Invoke(connId, bytes, channel);

View File

@ -241,7 +241,9 @@ public override void ServerSend(int connectionId, ArraySegment<byte> segment, in
public override void ServerStart()
{
#pragma warning disable CS0618 // Type or member is obsolete
wrap.OnServerConnected = OnServerConnected;
#pragma warning restore CS0618 // Type or member is obsolete
wrap.OnServerConnectedWithAddress = OnServerConnectedWithAddress;
wrap.OnServerDataReceived = OnServerDataReceived;
wrap.OnServerError = OnServerError;

View File

@ -42,7 +42,9 @@ public override void ClientConnect(string address)
public override bool ServerActive() => inner.ServerActive();
public override void ServerStart()
{
#pragma warning disable CS0618 // Type or member is obsolete
inner.OnServerConnected = OnServerConnected;
#pragma warning restore CS0618 // Type or member is obsolete
inner.OnServerConnectedWithAddress = OnServerConnectedWithAddress;
inner.OnServerDataReceived = OnServerDataReceived;
inner.OnServerDisconnected = OnServerDisconnected;

View File

@ -261,12 +261,14 @@ void AddServerCallbacks()
int transportIndex = i;
Transport transport = transports[i];
#pragma warning disable CS0618 // Type or member is obsolete
transport.OnServerConnected = (originalConnectionId =>
{
// invoke Multiplex event with multiplexed connectionId
int multiplexedId = AddToLookup(originalConnectionId, transportIndex);
OnServerConnected.Invoke(multiplexedId);
});
#pragma warning restore CS0618 // Type or member is obsolete
transport.OnServerConnectedWithAddress = (originalConnectionId, address) =>
{