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 4569978
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:17:47+00:00 2026-05-21T19:17:47+00:00

Hey all. I’m having an issue with c# and it quite possibly may be

  • 0

Hey all. I’m having an issue with c# and it quite possibly may be the debugger but I’m fairly new to c# (not new to c/c++)

There’s code below. Here is the issue I’m having.

I get UDP, not guaranteed delivery, sure. I expect that the occasional packet is dropped on the network or by windows if I’m stuffing the pipe full. However, the problem I am having is that after I create a new socket, I try and send a packet with 1 byte of data. This packet is dropped. I can try and send it twice, it’s dropped both times. However, if I send 1k worth of data, it goes through. If I create another socket (by clicking the button again), everything works fine. Now here’s the weird thing. If I stop and restart debugging the project without making any changes to the source, all my packets get sent without problems. It only seems to happen the on the first run after the project is built. Anyway, here’s the code to reproduce the issue. After a few hours of searching and reading I’m at a loss.
edit: Wanted to clarify that I’m using wireshark and can see that the packets are dropped.

    private void button1_Click(object sender, EventArgs e)
    {
        byte[] a = new byte[1] {0x00};
        byte[] b = new byte[1024];
        for(int i = 0; i < 1024; i++)
        {
            b[i] = 0xFF;
        }

        IPEndPoint _ipep = new IPEndPoint(IPAddress.Parse("192.168.200.202"),5546);
        Socket _server =  new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

        _server.SendTo(a, 1, SocketFlags.None, _ipep);
        _server.SendTo(a, 1, SocketFlags.None, _ipep);
        _server.SendTo(b, 1024, SocketFlags.None, _ipep);
    }
  • 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-21T19:17:47+00:00Added an answer on May 21, 2026 at 7:17 pm

    From your comment about ARP issue, I would like to suggest some ways to debug and narrow down the issue and then suggest some solutions.

    How to Debug:

    1. Try making the ARP entry “static” so
      that your PC do not send ARP request
      each time. To make ARP entry static
      you can write “arp” on command
      prompt to see the list of options
      and help to add static ARP entry.

    2. Another idea is to open the command
      prompt and write “ping
      192.168.200.202 -t”, so that your PC keeps on pinging the other client.
      This will keep your PC’s ARP entry
      up to date and when you will run
      your C# program, it will not send
      ARP again, and it will directly send
      the UDP.

    The above points are just to debug and ensure that you guessed the problem right.

    The Possible Solutions:

    1. If its the ARP issue, then I am almost sure that its problem with your network switch, so try replacing your “Switch” (I think its faulty).
    2. If it is possible for you then you can think of making your “ARP Entry” static. This might not be a good idea for all the situations and totally depend if nature of your application allows to go for this approach.

    I hope it helps.

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

Sidebar

Related Questions

Hey all. I have the following code: http://jsfiddle.net/g7Cgg/ As you can see, there are
Hey all, I am not quite getting why this doesn't seem to be working.
Hey all. We're sending quite a few emails (around 23k) using IIS6 SMTP service
Hey all. Is there a way to copy only a portion of a single
Hey all. I have a fairly simple question. I am developing a rich iPad
Hey all i am trying to delete a key from the registery but i
Hey all- I have looked this up on here and Google but none of
hey all, throwing this one out there... hope it's a simple one. using the
Hey all, I've got a question about IIS7 rewrite. I'm wondering if there is
Hey all i am probably overthinking this but how can i check the textbox

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.