mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 10:10:06 +00:00
[udp] update Socket::Open() to include NetifId (#10964)
This commit updates how the `NetifId` is set on a `Udp::Socket`. It is now specified as a parameter in the `Open()` call instead of `Bind()`. This change makes the socket more flexible by allowing the `NetifId` to be known earlier (which can be used for future optimizations). It also allows the desired `NetifId` to be set even when `Bind()` is not explicitly called, such as when `Connect()` or `SendTo()` are used on a socket that is not yet bound. Previously, `kNetifThread` was assumed by default in these situations. The public `otUdp` APIs are left unchanged to ensure backward compatibility.
This commit is contained in:
@@ -1076,8 +1076,8 @@ void TestSrpClientDelayedResponse(void)
|
||||
|
||||
sServerRxCount = 0;
|
||||
|
||||
SuccessOrQuit(udpSocket.Open());
|
||||
SuccessOrQuit(udpSocket.Bind(kServerPort, Ip6::kNetifThread));
|
||||
SuccessOrQuit(udpSocket.Open(Ip6::kNetifThread));
|
||||
SuccessOrQuit(udpSocket.Bind(kServerPort));
|
||||
|
||||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// Manually start the client with a message ID based on `testIter`
|
||||
|
||||
Reference in New Issue
Block a user