zeroc-ice / ice

All-in-one solution for creating networked applications with RPC, pub/sub, server deployment, and more.
https://zeroc.com
GNU General Public License v2.0
2.04k stars 592 forks source link

Don't check state twice in sendHeartbeat #2530

Closed pepone closed 2 months ago

pepone commented 2 months ago

The sendHeartbeat implementation checks _state == StateActive twice with the mutex locked, once should be enough.

https://github.com/zeroc-ice/ice/blob/f335b1572cce522886271bae5ae5b0c68258ded9/csharp/src/Ice/ConnectionI.cs#L1451-L1457

pepone commented 2 months ago

We don't become inactive while the conection is in holding state