예제 #1
0
 /// <summary>
 /// Send request to the service point and get the response.
 /// </summary>
 /// <returns></returns>
 private async Task<CoreResponseData> SendRequestAsync(Connection connection)
 {           
    try
    {
        await connection.ConnectAsync();
        //write a request header to the connection that established connected.    
        await this.WriteRequestAsync(connection);
        return await this.ReadResponseAsync(connection);
    }
    catch
    {
        connection.Close();
        throw;
    }
 }