Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to determine when a packet has been sent #292

Open
stockxiay opened this issue Oct 23, 2023 · 3 comments
Open

How to determine when a packet has been sent #292

stockxiay opened this issue Oct 23, 2023 · 3 comments

Comments

@stockxiay
Copy link

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?

@JereLeppanen
Copy link
Contributor

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.

@bogdanPricope
Copy link
Contributor

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

@bogdanPricope
Copy link
Contributor

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants