Questions tagged [sendasync]

83 questions
1
vote
1 answer

Why SmtpClient SendAsync throws Exceptions with combinations of UseDefaultCredentials and EnableSsl, while Send works fine

I'm using the System.Net.Mail. There are some topics around this area, but they are ASP.NET and often VB related. I'm isolating the code into a desktop skeleton code, I use .NET 3.5 and C#. So Send works in all scenario what I tried (EnableSsl…
Csaba Toth
  • 10,021
  • 5
  • 75
  • 121
1
vote
1 answer

C# HttpClient.SendAsync HttpMethod.Get - how to update cookie with additional values

I am trying to use C# HttpClient class to send Http Get message with cookies. HttpClient.GetAsync just accepts URL. So, I cannot use that method. I found that HttpClient.SendAsync method let me send cookies in following way. HttpRequestMessage…
0
votes
2 answers

creatig a asynchronus request

I am trying to implement an asynchornus request . I did my research and this is the best I got but the code is full of errors that I do not find the solution for NSURL *url2 = [NSURL URLWithString:@"www.google.com"]; NSURLRequest *urlRequest…
user1051935
  • 579
  • 1
  • 10
  • 29
0
votes
1 answer

sending many AsynchronousRequests gives an error

I'm doing some kind of finding my device using this code: NSOperationQueue* quququ; int i=0; for (i=0; i<256; i++) { //NSLog(@"%i",i); NSString *url=[NSString stringWithFormat:@"http://%i.%i.%i.%i/",myip1,myip2,myip3,i]; …
Horhe Garcia
  • 882
  • 1
  • 13
  • 28
0
votes
0 answers

Sending mail slow on IIS 7

I have written a code to send mail using SendAsync method of SMTP Client class. The codes work perfectly fine when I debug it. (i.e. running under webdevserver). But as soon as I host it on IIS 7, it just blows up. It is sending mails too slow and…
Sumit
  • 2,932
  • 6
  • 32
  • 54
0
votes
2 answers

Getting issue while using HttpClient/HttpClientFactory in .net core

We have implemented IHttpClientFactory to make the third party calls using HttpClient in .NET Core. However, we are still getting the below errors. System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been…
XamDev
  • 3,377
  • 12
  • 58
  • 97
0
votes
3 answers

.Net Framework - HttpClient SendAsync Error - Unable to read data from the transfer connection: the connection has been closed

I am trying to send a post request, but when debugging I am receiving the AggregateException: "An error occurred while copying content to a stream." with InnerException "Unable to read data from the transfer connection: the connection has been…
Colin Roe
  • 774
  • 1
  • 18
  • 35
0
votes
0 answers

Sendasync has stopped working , Not Posting data from swagger

Controller code: [HttpPost] [Route("mood")] public async Task ProcessMoodProfile([FromBody] MoodTelemetryDTO moodProfile) { string userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; var result = await…
Shri
  • 1
0
votes
1 answer

Sending syncronously with System.Net.WebSockets.SendAsync

I'm all in favour of multithreading and asyncronous tasks, but letting go of control isn't my cup of tea. I'm working on a project where one process is communicating with multiple targets over websockets, and sending should obviously be as speedy as…
Chris.J
  • 76
  • 2
0
votes
1 answer

.NET: Unable to read data from the transport connection: The I/O operation has been aborted

The below code is working in the .NET console application but not working in the .NET core console application. In the .NET Core console application I'm getting the error message The operation was canceled and the InnerException is Unable to read…
0
votes
1 answer

Is SmtpClient.SendAsync() really faster than SmtpClient.Send()

I was refactoring some of my code into a service and I was going to roll async all the way through down to my EmailService's Send() method. I was about to replace Send() with SendAsync() and noticed the extra callback parameter. Well decided to dig…
Sam
  • 4,766
  • 11
  • 50
  • 76
0
votes
2 answers

HttpClient SendAsync error - ResponseStatusCode does not indicate success

I am new to writing generic methods in C# and I am trying to create a generic SendAsync method in my c# project. Code is given below. HttpClientHelper.cs public static async Task ExecuteRequest(TIn request, string url) { Uri…
Learner
  • 15
  • 8
0
votes
2 answers

C# HttpClient Generic SendAysnc not working

I am new to writing generic methods in C# and I am trying to create a generic SendAsync method in my c# project. Code is given below. HttpClientHelper.cs public static async Task ExecuteRequest(T2 request, string url) { Uri…
Learner
  • 15
  • 8
0
votes
1 answer

How to check whether the access token is valid or not?

In the below code, am looking to renew access token if it is expired. But nothing works. I tried to debug with breakpoint on line return response but that breakpoint will not trigger. protected override async Task
0
votes
0 answers

(VB.net/.Net 4.0) Waiting for all SMTP SendAsync()

I have a thread program with VB.net which is generating reports and sending emails in async way after it. It is executed by batch file. The problem I am facing is, .bat is closed when not all smtp server sendasync are completed. However, email…
Edmund
  • 35
  • 1
  • 7