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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:43:18+00:00 2026-05-18T12:43:18+00:00

When sending two UDP messages to a computer on Windows 7, it looks like

  • 0

When sending two UDP messages to a computer on Windows 7, it looks like sometimes the first message is not sent at all. Has anyone else experienced this?

The test code below demonstrates the issue on my machine. When I run the test program and watch all UDP traffic to 10.10.42.22, I see the second UDP message being sent, but the first UDP message is not sent. If I immediately run the program again, then both UDP messages are sent.

It doesn’t fail every time, but it usually happens if I wait a couple minutes before running the test again.

#include <iostream>
#include <winsock2.h>

int main()
{
 WSADATA wsaData;
 WSAStartup( MAKEWORD(2,2), &wsaData );

 sockaddr_in addr;
 addr.sin_family = AF_INET;
 addr.sin_port = htons( 52383 );
 addr.sin_addr.s_addr = inet_addr( "10.10.42.22" );

 SOCKET s = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );

 if ( sendto( s, "TEST1", 5, 0, (SOCKADDR *) &addr, sizeof( addr ) ) != 5 )
  std::cout << "first message not sent" << std::endl;

 if ( sendto( s, "TEST2", 5, 0, (SOCKADDR *) &addr, sizeof( addr ) ) != 5 )
  std::cout << "second message not sent" << std::endl;

 closesocket( s );

 WSACleanup();
 return 0;
}
  • 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-18T12:43:18+00:00Added an answer on May 18, 2026 at 12:43 pm

    The problem here is basically the same as this post and it has to do with section 2.3.2.2 of RFC 1122:

    2.3.2.2 ARP Packet Queue

    The link layer SHOULD save (rather than
    discard) at least one (the latest)
    packet of each set of packets destined
    to the same unresolved IP address, and
    transmit the saved packet when the
    address has been resolved.

    It looks like opening a new socket for every UDP message is a workaround.

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

Sidebar

Related Questions

Sending a message from the Unix command line using mail TO_ADDR results in an
Sending a mail through my windows application to a person asking him to log
I'm looking into sending regular automated text-messages to a list of subscribed users. Having
We are sending out Word documents via email (automated system, not by hand). The
I'm trying to understand some behavior I'm seeing in the context of sending UDP
All right, let me preface this by saying: I'm not completely confident this is
I have two questions. First one is simple: Is there any way to control
When sending data using UDP, a destination port is needed to be specified. If
When sending two intents (One through startService followed by another through startActivityForResult for the
When sending data over HTTPS, I know the content is encrypted, however I hear

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.