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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:43:42+00:00 2026-05-23T14:43:42+00:00

I have two classes UDPSender and UDPReceiver. Senarios: (1)It works when I run UDPSender

  • 0

I have two classes UDPSender and UDPReceiver.
Senarios:
(1)It works when I run UDPSender in QNX and UDPReceiver in Linux.
(2)It doesn’t work when I run UDPSender in QNX and UDPReceiver in WindowsXP.(But I see UDP datagrams using Wireshark, meaning Sender is working as in Senario(1))
(3)It partially works in Windows.
i) if I use Sender sending UDP messages to 127.0.0.1, Receiver can get messages
ii) if I use Sender sending UDP messages to 192.168.1.137(local address in the network), Receiver can NOT receive.

My question is:

How can I get Receiver working on Windows?


some code:

UDPReceiver::UDPReceiver( boost::asio::io_service& service, unsigned short port )
: m_service( service ),
  m_socket( service, udp::endpoint(udp::v4(), port)),
  m_peerEndpoint(),
  m_buffer(),
  m_messageReceipient()
{
}

void UDPReceiver::SetMessageReceipient( const boost::function<void(const char*, unsigned int)>& r )
{
     m_messageReceipient = r;
}

void UDPReceiver::Start()
{
    m_socket.async_receive_from(
        boost::asio::buffer(m_buffer, m_buffer.size()), m_peerEndpoint,
        boost::bind( &UDPReceiver::HandleReceived, shared_from_this(),
                          boost::asio::placeholders::error,
                          boost::asio::placeholders::bytes_transferred));
}

void UDPReceiver::Stop()
{
    m_socket.close();
}

void UDPReceiver::HandleReceived( const boost::system::error_code& error, size_t bytesReceived )
{
    assert( !m_messageReceipient.empty() );
    if( error ) {
       LOG( Comms, Error, "UDPReceiver:" << error.message() );
    }
    else {
        m_messageReceipient( &m_buffer.front(), bytesReceived );
        m_socket.async_receive_from(
            boost::asio::buffer(m_buffer, m_buffer.size()), m_peerEndpoint,
            boost::bind( &UDPReceiver::HandleReceived, shared_from_this(),
                          boost::asio::placeholders::error,
                          boost::asio::placeholders::bytes_transferred));
    }
}
  • 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-23T14:43:42+00:00Added an answer on May 23, 2026 at 2:43 pm

    It’s probably being blocked by the Windows Firewall.

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

Sidebar

Related Questions

I have two classes that refer to each other, but obviously the compiler complains.
I have two classes in a many-to-many relationship, but only one of them have
I have two classes one and two . Both run threads. class Two is
I have two classes, but don't what kind of relation i should use. I
I have two classes generated by LINQ2SQL both from the same table so they
I have two classes.... Parcel and FundParcel...and I'm trying to convert an IEnumerable of
I have two classes; Area and LanguageArea . I use LanguageArea to handle translated
I have two classes that I would like to merge into a composite. These
I have two classes in a PHP application, B extending A for example. Class
I have two classes one of which inherits from the other. Im trying to

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.