Please keep the list in CC. kity hong wrote: > Hi,Jan > > In the source codes of my implemetation, I did register the reception > callback after binding to the respective port.
And that is the wrong order as packets can be queued once the socket is bound to a port (same is also true for other protocols than UDP, of course). Before that point, RTnet will simply drop any packet directed to an UDP port for which there is no local receiver. > but there was one > packet occupied in RTNET buffer which was a previous packet before > socket created. this packet made context->ops->recvmsg_rt() delay one > buffer to update the receiving packet. my question is whether there is > a method to flush socket in RTNET, that is clean up the stack > receiving packet at a requested time? If you really need this (for some other reason than this fixable startup race): Just recv(..., MSG_DONTWAIT) all packets in the queue until this service reports that the queue is empty. > > For the master never stops polling the slave, the packets are coming > to RTNET buffer before the socket is ready. > Is it possible to interrupt the packet receiver in RTNET till the > socket created successfully? > > Thank you for your quick reply. > > Kity Jan
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users