Class ApiPacket
Namespace: Tool.Sockets.NetFrame
Assembly: Tool.Net.dll
接口请求数据包
public class ApiPacketInheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), 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)
Remarks
代码由逆血提供支持
Constructors
ApiPacket(byte, byte)
数据包初始化
public ApiPacket(byte ClassID, byte ActionID)Parameters
ClassID byte
类ID
ActionID byte
方法ID
ApiPacket(byte, byte, int)
数据包初始化
public ApiPacket(byte ClassID, byte ActionID, int Millisecond)Parameters
ClassID byte
类ID
ActionID byte
方法ID
Millisecond int
请求等待的毫秒
ApiPacket(byte, byte, int, bool)
数据包初始化
public ApiPacket(byte ClassID, byte ActionID, int Millisecond, bool IsReply)Parameters
ClassID byte
类ID
ActionID byte
方法ID
Millisecond int
请求等待的毫秒
IsReply bool
是否需要有回复消息
Properties
ActionID
请求的方法ID
public byte ActionID { get; }Property Value
Bytes
当前消息携带的数据流
public ArraySegment<byte> Bytes { get; set; }Property Value
ClassID
请求的类ID
public byte ClassID { get; }Property Value
IsReply
是否需要有回复消息
public bool IsReply { get; }Property Value
Millisecond
默认等待超时时间为60秒
public int Millisecond { get; }Property Value
Methods
Remove(string)
从发送数据中移除所指定的键的值
public bool Remove(string key)Parameters
key string
键
Returns
是否成功移除
Set(string, object)
加入数据(如果有则修改)
public void Set(string key, object value)Parameters
key string
键
value object
值(支持传输转义)
Set(object)
加入数据,如果有则修改(以虚构对象参数传入,请确保已认真读注释。)(支持传输转义)
public void Set(object dictionary)Parameters
dictionary object
虚构对象
TryGet(string, out string)
获取键的值
public bool TryGet(string key, out string value)Parameters
key string
键
value string
要返回的值
Returns
是否存在