Skip to content

Interface INetworkListener<ISocket>

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

服务器模型二

csharp
public interface INetworkListener<ISocket> : INetworkListener, INetworkCore, IDisposable

Type Parameters

ISocket

Implements

INetworkListener, INetworkCore, IDisposable

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)

Properties

ListClient

当前连接的用户池

csharp
IReadOnlyDictionary<UserKey, ISocket> ListClient { get; }

Property Value

IReadOnlyDictionary<UserKey, ISocket>

Methods

CreateSendBytes(ISocket, int)

创建发送数据需要用的容器

csharp
SendBytes<ISocket> CreateSendBytes(ISocket client, int length)

Parameters

client ISocket

length int

Returns

SendBytes<ISocket>

SendAsync(SendBytes<ISocket>)

发送数据

csharp
ValueTask SendAsync(SendBytes<ISocket> sendBytes)

Parameters

sendBytes SendBytes<ISocket>

Returns

ValueTask

SetReceived(ReceiveEvent<ISocket>)

接收数据委托

csharp
void SetReceived(ReceiveEvent<ISocket> Received)

Parameters

Received ReceiveEvent<ISocket>

TrySocket(in UserKey, out ISocket)

根据key获取连接池中的用户

csharp
bool TrySocket(in UserKey key, out ISocket client)

Parameters

key UserKey

client ISocket

Returns

bool

基于Apache-2.0协议开源