示例#1
0
        public override async Task <Mapping> DeletePortMapAsync(Mapping mapping)
        {
            var message  = new DeletePortMappingMessage(mapping, this);
            var response = await SendMessageAsync(message).ConfigureAwait(false);

            if (!(response is DeletePortMapResponseMessage))
            {
                throw new MappingException(ErrorCode.Unknown, "Invalid response received when deleting the port map");
            }
            return(mapping);
        }
示例#2
0
        /// <summary>
        /// Removes a port mapping from this computer
        /// </summary>
        public override IAsyncResult BeginDeletePortMap(Mapping mapping, AsyncCallback callback, object asyncState)
        {
            DeletePortMappingMessage message = new DeletePortMappingMessage(mapping, this);

            return(BeginMessageInternal(message, callback, asyncState, EndDeletePortMapInternal));
        }