Ejemplo n.º 1
0
        internal void _RemoveHiddenClientPingChannel(int peerID)
        { //SERVERSIDE
            UDPChannel pingChannel = this._clientsPingChannels.Where(a => a.Name == UDPManager._UDPMRCP + ":" + peerID).FirstOrDefault();

            this._clientsPingChannels.RemoveAt(this._clientsPingChannels.IndexOf(pingChannel));
            pingChannel.RemoveEventListener <UDPManagerEvent>(UDPManagerEvent._SEND_DATA, this._SendDataFromChannel);
            pingChannel.RemoveEventListener <UDPManagerEvent>(UDPManagerEvent.Names.DATA_DELIVERED, this._DeliveredNotifForward);
            pingChannel.RemoveEventListener <UDPManagerEvent>(UDPManagerEvent.Names.DATA_RETRIED, this._RetryNotifForward);
            pingChannel.RemoveEventListener <UDPManagerEvent>(UDPManagerEvent.Names.DATA_CANCELED, this._CancelNotifForward);
            pingChannel._Close();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes a UDPChannel on the instance</summary>
        /// <param name='channelName'>The name of the channel you want to remove.</param>
        /// <c>It must be registered on this instance, if a channel with that name can't be found the method will throw an exception!</c>
        /// <remarks>You can check if the name is registered by calling <see cref="GetChannelByName"/></remarks>
        public void RemoveChannel(string channelName)
        {
            UDPChannel channel = this.GetChannelByName(channelName);

            channel.RemoveEventListener <UDPManagerEvent>(UDPManagerEvent._SEND_DATA, this._SendDataFromChannel);
            channel.RemoveEventListener <UDPManagerEvent>(UDPManagerEvent.Names.DATA_DELIVERED, this._DeliveredNotifForward);
            channel.RemoveEventListener <UDPManagerEvent>(UDPManagerEvent.Names.DATA_RETRIED, this._RetryNotifForward);
            channel.RemoveEventListener <UDPManagerEvent>(UDPManagerEvent.Names.DATA_CANCELED, this._CancelNotifForward);
            channel._Close();
            this._channels.Remove(channel);
        }