Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 869393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:17:53+00:00 2026-05-15T10:17:53+00:00

When I want to received UDP datagrams asynchronously, I write call BeginReceiveFrom of a

  • 0

When I want to received UDP datagrams asynchronously, I write call BeginReceiveFrom of a System.Net.Sockets.Socket class. The BeginReceiveFrom method expects an Endpoint as the remoteEP parameter.

public IAsyncResult BeginReceiveFrom (
  byte[] buffer,
  int offset,
  int size,
  SocketFlags socketFlags,
  ref EndPoint remoteEP,
  AsyncCallback callback,
  Object state
)

This Method starts an asynchronous receive and cannot return any result in remoteEP since it returns immediately. Is this parameter for a kind of filtering or will it be modified on receive completion?

In the receive handler I call EndReceiveFrom, where I also have to pass a reference to an Enpoint object as the endPoint parameter.

public int EndReceiveFrom (
  IAsyncResult asyncResult,
  ref EndPoint endPoint
)

The EndReceiveFrom indicates with this Endpoint object the sender of the UDP frame. Why must I pass a remoteEP to the BeginReceiveFrom and can I avoid this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:17:54+00:00Added an answer on May 15, 2026 at 10:17 am

    There’s no overloads that do not require an endpoint, but that doesn’t mean you have to specify specific endpoints. You can specify any ip address as the remoteEP.

    EndPoint remoteEP = (EndPoint)(new IPEndPoint(IPAddress.Any, 0));
    

    EndReceiveFrom expects a pass by ref variable that will be populated by the method call itself. You can instantiate the endPoint similarly.

    EndPoint receivedFromEP = new IPEndPoint(IPAddress.Any, 0);
    

    After the call is made, simply ignore the value of receivedFromEP if you do not need it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use UDP-Sockets for my XNA-Networkgame. And now I am trying to
I want to received raw TCP packet and then send it back with same
I want to filter e-mail headers received on my Postfix mail receiving server. I
I want to list messages that received specific user from other users group by
I want to add a commit hook that works when a push is received
I received DateTime String from Fedex in following format 2012-06-22T21:39:48-05:00 I want to convert
I've received a new computer from my employer. This time I don't want to
I want to plot email from and to in world. For example, I received
Update: Based on a couple of the answers I have received, I just want
I want to receive email to my email address through my asp.net application. Its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.