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

tcp-chnl: add TCP connection established callback for connect and accept #372

Merged

Conversation

jalalmostafa
Copy link
Contributor

CNDP follows an asynchronous pattern. We cannot call some functions before the connection is established e.g. chnl_send, so we need a notification that the TCP connection has been established.
The commit adds calls to the TCP connection callback for clients when they establish a connection i.e. the connection is ready to send and receive data.

To simplify things, CHNL_TCP_ACCEPT_TYPE is renamed to CHNL_TCP_ESTABLISHED_TYPE. The callback type is used for both the server's accept and the client's connect. In the case of accept, the listening channel descriptor is passed to the callback. In the case of connect, the client channel descriptor is passed.

The commit adds calls the TCP connection callback for clients when they
establish a connection i.e. the connection is ready to send and receive
data.

To simplify things, `CHNL_TCP_ACCEPT_TYPE` is renamed to
`CHNL_TCP_ESTABLISHED_TYPE`. The callback type is used for both
server's `accept` and client's `connect`. In case of accept, the
listening channel descriptor is passed to the callback. In case of
connect, the client channel descriptor is passed.

Signed-off-by: Jalal Mostafa <[email protected]>
Copy link
Contributor

@maryamtahhan maryamtahhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me

Copy link

@pktgen pktgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Contributor

@KeithWiles KeithWiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix

@KeithWiles KeithWiles merged commit 75ba078 into CloudNativeDataPlane:main Jun 20, 2024
6 checks passed
@jalalmostafa jalalmostafa deleted the tcp-connect-notif branch June 22, 2024 10:00
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

Successfully merging this pull request may close these issues.

4 participants