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(); _credentials = EncryptionCredentials.Generate();
} }
#pragma warning disable CS0618 // Type or member is obsolete
inner.OnServerConnected = HandleInnerServerConnected; inner.OnServerConnected = HandleInnerServerConnected;
#pragma warning restore CS0618 // Type or member is obsolete
inner.OnServerConnectedWithAddress = HandleInnerServerConnected; inner.OnServerConnectedWithAddress = HandleInnerServerConnected;
inner.OnServerDataReceived = HandleInnerServerDataReceived; inner.OnServerDataReceived = HandleInnerServerDataReceived;
inner.OnServerDataSent = (connId, bytes, channel) => OnServerDataSent?.Invoke(connId, bytes, channel); 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() public override void ServerStart()
{ {
#pragma warning disable CS0618 // Type or member is obsolete
wrap.OnServerConnected = OnServerConnected; wrap.OnServerConnected = OnServerConnected;
#pragma warning restore CS0618 // Type or member is obsolete
wrap.OnServerConnectedWithAddress = OnServerConnectedWithAddress; wrap.OnServerConnectedWithAddress = OnServerConnectedWithAddress;
wrap.OnServerDataReceived = OnServerDataReceived; wrap.OnServerDataReceived = OnServerDataReceived;
wrap.OnServerError = OnServerError; wrap.OnServerError = OnServerError;

View File

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

View File

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