using System.Net; namespace NahidaImpact.Kcp { /// /// Multiplex many channels or conversations over the same transport. /// public interface IKcpMultiplexConnection : IKcpMultiplexConnection { /// /// Create a raw channel with the specified conversation ID. /// /// The conversation ID. /// The remote Endpoint /// The user state of this channel. /// The options of the . /// The raw channel created. /// The current instance is disposed. /// Another channel or conversation with the same ID was already registered. KcpRawChannel CreateRawChannel(long id, IPEndPoint remoteEndpoint, T state, KcpRawChannelOptions options = null); /// /// Create a conversation with the specified conversation ID. /// /// The conversation ID. /// The remote Endpoint /// The user state of this conversation. /// The options of the . /// The KCP conversation created. /// The current instance is disposed. /// Another channel or conversation with the same ID was already registered. KcpConversation CreateConversation(long id, IPEndPoint remoteEndpoint, T state, KcpConversationOptions options = null); /// /// Register a conversation or channel with the specified conversation ID and user state. /// /// The conversation or channel to register. /// The conversation ID. /// The user state /// is not provided. /// The current instance is disposed. /// Another channel or conversation with the same ID was already registered. void RegisterConversation(IKcpConversation conversation, long id, T? state); /// /// Unregister a conversation or channel with the specified conversation ID. /// /// The conversation ID. /// The user state. /// The conversation unregistered with the user state. Returns default when the conversation with the specified ID is not found. IKcpConversation UnregisterConversation(long id, out T? state); } }