Skip to content

Conversation

@boivie
Copy link
Collaborator

@boivie boivie commented Dec 1, 2025

This change exposes the basic functionality required to establish a dcSCTP connection from a C++ application. It adds FFI bindings for connect, handle_input, and poll_event.

To model this in C++, poll_event now returns an Event struct, which can be used to distinguish between different socket events such as OnConnected and SendPacket. As the cxx FFI doesn't support rich types such as std::variant, having a fat struct as interface between Rust and C++ is simple and doesn't add much overhead.

The C++ example in dcsctp-cxx/examples/main.cpp has been updated to demonstrate the explicit connection handshake between two sockets, mirroring the logic in the establish_connection Rust test.

This change exposes the basic functionality required to establish a
dcSCTP connection from a C++ application. It adds FFI bindings for
`connect`, `handle_input`, and `poll_event`.

To model this in C++, `poll_event` now returns an `Event` struct, which
can be used to distinguish between different socket events such as
`OnConnected` and `SendPacket`. As the cxx FFI doesn't support rich
types such as std::variant, having a fat struct as interface between
Rust and C++ is simple and doesn't add much overhead.

The C++ example in `dcsctp-cxx/examples/main.cpp` has been updated to
demonstrate the explicit connection handshake between two sockets,
mirroring the logic in the `establish_connection` Rust test.
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.

1 participant