Skip to content

Struct NetResponse ​

Namespace: Tool.Sockets.NetFrame
Assembly: Tool.Net.dll

请求服务器返回的数据包信息类(请务必回收资源!!!)

csharp
public readonly struct NetResponse : IDisposable

Implements ​

IDisposable

Inherited Members ​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods ​

ObjectExtension.Add<T>(object, object, object), ObjectExtension.CopyEntity(object, object, params string[]), ObjectExtension.EntityToJson(object), ObjectExtension.EntityToJson(object, bool), ObjectExtension.EntityToJson(object, bool, string), DictionaryExtension.GetDictionary(object), TypeExtension.GetFieldKey(object, string, out bool), TypeExtension.GetFieldKey<T>(object, string, out bool), TypeExtension.GetFieldKey(object, Type, string, out bool), ObjectExtension.GetIntPtr(object), ObjectExtension.GetIntPtrInt(object), TypeExtension.GetPropertieFind(object, string, bool), TypeExtension.GetProperties(object), TypeExtension.GetPropertyKey(object, string, out bool), TypeExtension.GetPropertyKey<T>(object, string, out bool), TypeExtension.GetPropertyKey(object, Type, string, out bool), TypeExtension.GetValue(object, PropertyDescriptor), TypeExtension.GetValue(object, string, bool), TypeExtension.GetValue(object, string), ObjectExtension.Read<T>(object, object, int, int), ObjectExtension.Read<T>(object, int, object, int, int), DictionaryExtension.SetDictionary(object, IDictionary<string, object>), TypeExtension.SetFieldKey(object, string, object), TypeExtension.SetFieldKey<T>(object, string, object), TypeExtension.SetFieldKey(object, Type, string, object), TypeExtension.SetPropertyKey(object, string, object), TypeExtension.SetPropertyKey<T>(object, string, object), TypeExtension.SetPropertyKey(object, Type, string, object), TypeExtension.SetValue(object, PropertyDescriptor, object), TypeExtension.SetValue(object, string, object, bool), TypeExtension.SetValue(object, string, object), ObjectExtension.ToBase64String(object), ObjectExtension.ToBytes(object), ObjectExtension.ToBytes(object, out Type), DictionaryExtension.ToDictionary(object), DictionaryExtension.ToDictionary<T>(object), DictionaryExtension.ToIDictionary(object), DictionaryExtension.ToIDictionary<T>(object), ObjectExtension.ToJson(object), ObjectExtension.ToJson(object, JsonSerializerOptions), ObjectExtension.ToJsonWeb(object), ObjectExtension.ToJsonWeb(object, Action<JsonSerializerOptions>), ObjectExtension.ToTryVar<T>(object, T), ObjectExtension.ToVar<T>(object), ObjectExtension.ToVar(object, Type, bool), ObjectExtension.ToVar(object, string), ObjectExtension.ToXml(object)

Constructors ​

NetResponse(in Guid, bool, NetFrameState, Exception) ​

未完成时

csharp
public NetResponse(in Guid onlyId, bool isreply, NetFrameState state, Exception error)

Parameters ​

onlyId Guid

isreply bool

state NetFrameState

error Exception

NetResponse(in IDataPacket) ​

完成后

csharp
public NetResponse(in IDataPacket packet)

Parameters ​

packet IDataPacket

Properties ​

Array ​

当前消息携带的数据流

csharp
public ArraySegment<byte> Array { get; }

Property Value ​

ArraySegment<byte>

Bytes ​

当前消息携带的数据流

csharp
public Memory<byte> Bytes { get; }

Property Value ​

Memory<byte>

Error ​

当前发生的异常

csharp
public Exception Error { get; }

Property Value ​

Exception

IsReply ​

是否需要有回复消息

csharp
public bool IsReply { get; }

Property Value ​

bool

OnlyId ​

消息唯一ID

csharp
public Guid OnlyId { get; }

Property Value ​

Guid

Span ​

当前消息携带的数据流

csharp
public Span<byte> Span { get; }

Property Value ​

Span<byte>

State ​

用于表示当前数据包的执行情况

csharp
public NetFrameState State { get; }

Property Value ​

NetFrameState

Text ​

数据包(文字类型的数据)

csharp
public string Text { get; }

Property Value ​

string

Methods ​

Dispose() ​

回收资源

csharp
public void Dispose()

基于Apache-2.0协议开源