整理部分底层代码

This commit is contained in:
Kimdiego2098
2023-11-27 16:17:12 +08:00
parent 665d616a06
commit 7e2e17d38b
2 changed files with 7 additions and 7 deletions

View File

@@ -69,7 +69,7 @@ public abstract class ReadWriteDevicesUdpSessionBase : ReadWriteDevicesBase
/// <inheritdoc/>
public override string ToString()
{
return UdpSession.RemoteIPHost.ToString();
return UdpSession.RemoteIPHost?.ToString();
}
/// <inheritdoc/>

View File

@@ -53,7 +53,7 @@ public abstract class ReadWriteDevicesUdpDataHandleAdapter<TRequest> : UdpDataHa
/// <inheritdoc/>
public override string ToString()
{
return (Owner as UdpSession)?.RemoteIPHost.ToString();
return (Owner as UdpSession)?.RemoteIPHost?.ToString();
}
/// <summary>
@@ -83,11 +83,11 @@ public abstract class ReadWriteDevicesUdpDataHandleAdapter<TRequest> : UdpDataHa
var allBytes = byteBlock.ToArray(0, byteBlock.Len);
Logger?.Trace($"{FoundationConst.LogMessageHeader}{ToString()}- 接收:{(IsHexData ? allBytes.ToHexString(' ') : Encoding.UTF8.GetString(allBytes))}");
if (Request?.SendBytes == null)
{
GoReceived(remoteEndPoint, byteBlock, null);
return;
}
//if (Request?.SendBytes == null)
//{
// GoReceived(remoteEndPoint, byteBlock, null);
// return;
//}
byte[] header = new byte[] { };
if (Request.HeadBytesLength > 0)
{