Skip to content

Commit

Permalink
Mark UDP socket as ready for write in send msg.
Browse files Browse the repository at this point in the history
This unblock the pending select.
  • Loading branch information
pan- committed Jun 25, 2021
1 parent fb54fc4 commit 902383f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/inet/UDPEndPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ INET_ERROR UDPEndPoint::SendMsg(const IPPacketInfo * pktInfo, System::PacketBuff
SuccessOrExit(res);

res = IPEndPointBasis::SendMsg(pktInfo, std::move(msg), sendFlags);

// Wait for ability to write on this endpoint.
mSocket.SetCallback(HandlePendingIO, reinterpret_cast<intptr_t>(this));
mSocket.OnRequestCallbackOnPendingWrite();
#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS

#if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK
Expand Down

0 comments on commit 902383f

Please sign in to comment.