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

  • Home
  • SEARCH
  • 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 8079461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:06:30+00:00 2026-06-05T16:06:30+00:00

I have already googled and searched stackoverflow but I can find nothing related to

  • 0

I have already googled and searched stackoverflow but I can find nothing related to my problem.

First of all, let me describe briefly the scene.

Imagine a camera sending all the time pieces (from now on I will call them ‘chunks’) of JPEG through the network by UDP. Using UDP is a constraint, I cannot change that, so please do not answer ‘why don’t you use TCP?’, because you know my point: ‘Because I can’t’.

On the other side a client receives the chunks sent by the cam. To build a kind of flow control I have set three fields (three bytes to store JPEG number, chunk index, amount of chunks) at the beginning of my datagram, and after that the chunk itself.

By the moment I am testing both sides in my own laptop sending and receiving through the loopback (127.0.0.1) but the problem is that while the camera (sender) says it has sent all the chunks propperly (I am testing with a single JPEG picture that gets splitted in 161 chunks) the client receives a random number of pieces (sometimes near 70, some others 100, and a few times all of them). I have tried sniffing my loopback with rawcap (http://www.netresec.com/?page=RawCap) and it detects another amount of UDP ‘datagrams’, different from 161 (which is supposed to be sent), and from the amount the client claims to have received.

So, is it possible that the send sentence is not working as expected? Any other suggestion to continue investigation?

Here is my sending method.

    private void startSendingData(IPEndPoint target)
    {
        fatherForm.writeMessage("START command received. Sending data to " + target.Address.ToString() + " port " + target.Port.ToString() + "...");


        //Get chunks prepared
        List<byte[]> listOfChunks = getChunksInAList(collectFiles());
        List<uint> chunksSucces = new List<uint>();
        List<uint> chunksFailed = new List<uint>();

        byte[] stopDatagram = getStopDatagram();

        //Initialise the socket
        Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

        Stopwatch sw = Stopwatch.StartNew();                       

        foreach (byte[] chunk in listOfChunks)
        {
            if (s.SendTo(chunk, target) == chunk.Length)
                chunksSucces.Add(BitConverter.ToUInt32(chunk,sizeof(uint)));
            else
                chunksFailed.Add(BitConverter.ToUInt32(chunk, sizeof(uint)));
        }

        Debug.WriteLine(chunksSucces.Count + " sent successfully");

        //Tell the receiver not to continue receiving
        s.SendTo(stopDatagram, target);

        long ellapsedMs = sw.ElapsedMilliseconds;
        sw.Stop();

        writeTransmissionRate(listOfChunks.Count, ellapsedMs);

        Debug.WriteLine(sw.ElapsedMilliseconds + "ms ellapsed");
        sw.Stop();

        s.Close();
    }

And the output is:

161 chunks to be sent
161 sent successfully
6ms ellapsed
Transmission rate: 37000.65KB/s 36.13MB/s

But at the other side I only recieve 22 datagrams in this test.

Thank you in advance.

  • 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-06-05T16:06:32+00:00Added an answer on June 5, 2026 at 4:06 pm

    UDP is not guaranteed. The network stack may be dropping packets if your receive function is not processing them fast enough.

    Try sending them slower, or increasing your UDP receive buffer:

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

Sidebar

Related Questions

I've searched all posts on google and stackoverflow but I simply can't solve this
I googled,I binged,I already have seen the other duplicates here,but none of them work
I have already read some posts, but no one helped me with my problem.
I have already read some articles and searched on Google, but I failed to
i have already searched through google, and many refence, but i only see a
Okay, so I have searched a while for a solution to this problem, but
First, yes I have searched already and found this answer already: GWT JSNI -
I have already pushed all the changes to the server. Here is the order
I have already surveyed SO for an answer, and could not find an appropriate
I have already searched Google and I am finding no tool to convert fractional

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.