public override async Task CreatePortMap(Mapping mapping) { CreatePortMappingMessage message = new CreatePortMappingMessage(mapping, localAddress, this); using (await _httpClient.SendAsync(message.Encode(), message.Method).ConfigureAwait(false)) { } }
public override async Task <Mapping> CreatePortMapAsync(Mapping mapping) { var message = new CreatePortMappingMessage(mapping, LocalAddress, this); var response = await SendMessageAsync(message).ConfigureAwait(false); if (!(response is CreatePortMappingResponseMessage)) { throw new MappingException(ErrorCode.Unknown, "Invalid response received when creating the port map"); } return(mapping); }
/// <summary> /// Maps the specified port to this computer /// </summary> public override IAsyncResult BeginCreatePortMap(Mapping mapping, AsyncCallback callback, object asyncState) { CreatePortMappingMessage message = new CreatePortMappingMessage(mapping, localAddress, this); return(BeginMessageInternal(message, callback, mapping, EndCreatePortMapInternal)); }
public override Task CreatePortMap(Mapping mapping) { CreatePortMappingMessage message = new CreatePortMappingMessage(mapping, localAddress, this); return(_httpClient.SendAsync(message.Encode(), message.Method)); }