0

I would like to pass a custom parameter to the ReceiveCompleted event handler via the ReceiveCompletedEventArgs object. I don't want a timeout, but it seems as though there is no constructor (other than BeginReceive()) that doesn't expect a timeout value. Is there any workaround for this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
David P
  • 2,027
  • 3
  • 15
  • 27
  • Please show your progress so far. Thank you – tom redfern Dec 07 '18 at 21:53
  • Note you can simplify your life by using TaskFactoty.FromAsync https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.taskfactory.fromasync?view=netframework-4.7.2 to adapt the old async API into the new Task-based async with first-class language support. https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/await-operator – David Browne - Microsoft Dec 09 '18 at 18:53

1 Answers1

0

I figured it out. Just pass in MessageQueue.InfiniteTimeout

David P
  • 2,027
  • 3
  • 15
  • 27