Boost logo

Boost Users :

Subject: [Boost-users] why send_to does not send all the packets..?
From: Paolo Viotti (skypixel_at_[hidden])
Date: 2009-08-27 11:08:15


Hi,

I'm using the boost asio library to create and manage a UDP socket.
In my code I've a for loop in which I send some packets, as follows:

for (it=refreshList.begin(); it !=refreshList.end(); it++){
        [...]
        std::cout<<"___Refreshing: sent a KADEMLIA2_HELLO_REQ packet to "<<
(*it)->getAddressString()<<":"<<(*it)->getUDPPort()<<std::endl;
        Packet* packet = new Packet(CList->getMyNodeID(),true); //
KADEMLIA2_HELLO_REQ
        socket->send_to(boost::asio::buffer(packet->getPacket(),
packet->getSize()), (*re));
}

and actually it sends the packets, but just some of them: it stops sending
after having sent about 30 packets out of 150, without throwing any
exception or giving any error, while the loop continue and all the strings
are regularly printed on std::cout.
i'm really puzzled... is there any buffer to flush or any shutdown timer to
take into account..? could it be due to another thread that is blocked on
the receive_from function..?

thanks,

p_viotti



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net