Open stockxiay opened 8 months ago
With a TCP socket, you should be able to use the OFP_MSG_NBIO (non-blocking I/O) flag with ofp_send().
To confirm that packet is sent, you might find the packet counters returned by ofp_get_packet_statistics() useful.
Hi @stockxiay,
If you have considered using ofp_epoll or ofp_select() to determine if a descriptor is writable.... it will not work. Current OFP version does not support this functionality.
However you may try this version that provide it: https://github.com/NetInoSoftware/nfp
ofp_send() do return the number of bytes sent or -1 on error. However, even if the bytes are reported as 'sent', OFP may store them (a small number of packets, store per thread) to favor burst sending. The size of the burst is configurable (default 1).
Application can force the sending of the stored packets with ofp_send_pending_pkt().
Before I call ofp_send, how do I determine whether the current descriptor is writable and how do I confirm that the data packet is sent?