public abstract class UdpSessionBase : ServiceBase,
IUdpSessionBase, IServiceBase, ISetupConfigObject, IResolverConfigObject, IConfigObject,
IDependencyObject, IDisposableObject, IDisposable, ILoggerObject, IPluginObject,
IResolverObject, IClient
Public MustInherit Class UdpSessionBase
Inherits ServiceBase
Implements IUdpSessionBase, IServiceBase, ISetupConfigObject, IResolverConfigObject,
IConfigObject, IDependencyObject, IDisposableObject, IDisposable, ILoggerObject,
IPluginObject, IResolverObject, IClient
[<AbstractClassAttribute>]
type UdpSessionBase =
class
inherit ServiceBase
interface IUdpSessionBase
interface IServiceBase
interface ISetupConfigObject
interface IResolverConfigObject
interface IConfigObject
interface IDependencyObject
interface IDisposableObject
interface IDisposable
interface ILoggerObject
interface IPluginObject
interface IResolverObject
interface IClient
end
UdpSessionBase | 构造函数,初始化UDP会话基类。 |
Config |
配置项
(继承自 SetupConfigObject。) |
DisposedValue |
标识该对象是否已被释放
(继承自 DisposableObject。) |
IsClient | 在Udp中,该值没有意义,且可以自由赋值。 |
LastReceivedTime | 最后一次接收到数据的时间 |
LastSentTime | 最后一次发送数据的时间 |
Logger |
日志记录器
(继承自 ConfigObject。) |
Monitor | |
PluginManager |
插件管理器
(继承自 SetupConfigObject。) |
ProtectedDataHandlingAdapter | 数据处理适配器 |
Protocol | 终端协议 |
RemoteIPHost | |
Resolver |
获取解析器实例。
(继承自 SetupConfigObject。) |
ServerName |
服务器名称
(继承自 ServiceBase。) |
ServerState |
服务器状态
(重写 ServiceBaseServerState) |
CloneTo |
将当前对象的依赖项克隆到目标对象中
(继承自 DependencyObject。) |
Dispose |
释放资源。内部已经处理了SuppressFinalize(Object) (继承自 DisposableObject。) |
Dispose(Boolean) |
处置资源
(重写 SetupConfigObjectDispose(Boolean)) |
DropMulticastGroup | 从组播组中退出。 |
Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) |
GetHashCode | Serves as the default hash function. (继承自 Object。) |
GetType | Gets the Type of the current instance. (继承自 Object。) |
GetValueTValue |
获取依赖注入的值,当没有注入时,会返回默认行为的值。
(继承自 DependencyObject。) |
HasValueTValue |
判断在当前对象中是否有已设置的属性值。
(继承自 DependencyObject。) |
JoinMulticastGroup |
加入组播。
组播地址为 224.0.0.0 ~ 239.255.255.255,其中 224.0.0.0~224.255.255.255 不建议在用户程序中使用,因为它们一般都有特殊用途。 |
LoadConfig |
加载配置
(重写 SetupConfigObjectLoadConfig(TouchSocketConfig)) |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) |
OnUdpReceived | 处理已接收到的数据。 |
OnUdpSending | 在UDP数据即将发送时触发插件。 如果当前类覆盖了父类的方法,则不会触发插件。 |
PreviewBind | 在Socket初始化对象后,Bind之前调用。 可用于设置Socket参数。 父类方法可覆盖。 |
ProtectedClearReceiver | 清除当前的UDP接收器对象。 |
ProtectedCreateReceiver | 创建或获取一个UDP接收器对象。 |
ProtectedDefaultSendAsync(ReadOnlyMemoryByte) | 异步发送只读字节内存到远程主机。 此方法提供了一种默认的发送方式,确保只有在可以发送且远程IP主机不为空时才尝试发送数据。 |
ProtectedDefaultSendAsync(EndPoint, ReadOnlyMemoryByte) | 异步发送数据到指定的端点。 此方法用于封装实际的数据发送逻辑,在发送之前会进行必要的检查和调用事件处理程序,以确保数据的正确发送。 |
ProtectedSendAsync(IListArraySegmentByte) | 异步安全发送数据方法。 本方法提供了一种安全的异步数据发送方式,确保在发送过程中, 使用了端点信息并且避免了潜在的空引用错误。 |
ProtectedSendAsync(IRequestInfo) | 异步发送数据,使用提供的请求信息。 |
ProtectedSendAsync(ReadOnlyMemoryByte) | 异步发送数据,使用提供的内存数据。 |
ProtectedSendAsync(EndPoint, IListArraySegmentByte) | 异步发送数据到指定的端点。 |
ProtectedSendAsync(EndPoint, ReadOnlyMemoryByte) | 异步发送数据到指定的端点。 该方法通过适配器转发数据,如果适配器未设置,则采用默认发送方式。 |
ProtectedSendAsync(EndPoint, IRequestInfo) | 异步发送请求信息到指定的端点。 在发送之前,会检查是否具备发送请求信息的能力,并通过适配器进行发送。 |
ReceivingData | 当收到原始数据时,处理数据。 该方法提供了一个机制,通过该机制可以对原始数据进行自定义处理,而不必修改具体的传输逻辑。 |
RemoveValueTValue |
移除属性值。
(继承自 DependencyObject。) |
SetAdapter | 设置适配器 |
SetupAsync |
异步配置设置项
(继承自 SetupConfigObject。) |
SetValueTValue |
设置依赖注入的值,如果值已经存在,将被覆盖。
(继承自 DependencyObject。) |
StartAsync |
异步启动
(重写 ServiceBaseStartAsync) |
StopAsync |
异步停止
(重写 ServiceBaseStopAsync) |
ThrowIfConfigIsNull |
如果Config为空,则抛出ArgumentNullException的异常。
(继承自 ConfigObject。) |
ThrowIfDisposed |
判断当前对象是否已经被释放。
如果已经被释放,则抛出ObjectDisposedException异常。
(继承自 DisposableObject。) |
ToString | Returns a string that represents the current object. (继承自 Object。) |
TryGetValueTValue |
尝试获取依赖注入的值,当没有注入时,会返回。
(继承自 DependencyObject。) |
TryRemoveValueTValue |
尝试重置属性值,如果没有这个值,则返回。
(继承自 DependencyObject。) |
Map | (由 Mapper 定义。) |
Map | (由 Mapper 定义。) |
MapTTarget | (由 Mapper 定义。) |
SafeDispose |
安全性释放(不用判断对象是否为空)。不会抛出任何异常。
内部会判断DisposedValue的值,如果为,则不会再执行Dispose。 (由 SystemExtension 定义。) |
SafeDispose |
安全性释放(不用判断对象是否为空)。不会抛出任何异常。
(由 SystemExtension 定义。) |
Setup |
同步配置方法。
使用给定的配置对象进行设置。
(由 SetupConfigObjectExtension 定义。) |
ToJsonString |
转换为Json
(由 SerializeConvert 定义。) |