Menu

#174 Socket is closed, even if in use

1.4.0.0
closed
None
2017-11-09
2017-09-26
No

Current Implementation:
After opening a socket (in trdp_requestSocket) the usage-counter (iface[x].usage) is set to 0. If the usage-counter is lessequal than 0, the socket is closed (trdp_releaseSocket). But if the usage-counter is 0, the socket is still in use and must not be closed.

Suggested Fix:
The socket must be closed, if the usage-counter is less than zero.

Discussion

  • Bernd Löhr

    Bernd Löhr - 2017-11-06
    • status: open --> pending
    • assigned_to: Bernd Löhr
     
  • Bernd Löhr

    Bernd Löhr - 2017-11-09
    • status: pending --> closed
     
  • Bernd Löhr

    Bernd Löhr - 2017-11-09

    The meaning of the usage field is as reference-counter: 0 not used, > 0 used.
    The socket usage counter may be checked from outside of trdp_utils but not be altered.

     
  • Christoph Felser

    As the following example shows, the socket is closed too early:
    e.g .TRDP-PD over UDP:

    1. trdp_requestSocket -> socket is opened and usage set to 0
    2. trdp_requestSocket -> socket already exists, usage incremented to 1
    3. trdp_releaseSocket -> usage decremented to 0, sock is closed!
     

Log in to post a comment.

MongoDB Logo MongoDB