You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
atserver_connection_free also closes the socket, which means that if you have multiple references to an atserver_connection, such as when you fork a process. Then the first call to free will disconnect and free as intended. Every subsequent attempt to use this connection will then fail as the program state thinks its connected when its not.
Generally also, you don't want to disconnect the socket until the last instance has been closed. These actions shouldn't be coupled together. The reason for this is the underlying memory that was cloned is pointed at the same file descriptor for the socket.
The TLS socket layer doesn't have this coupled behavior, only the atserver_connection code does.
Edit: actually, TLS socket layer does have this behavior, as a result of mbedtls_net_free having this behavior. Enhancement request filed with mbedtls: Mbed-TLS/mbedtls#9958
The text was updated successfully, but these errors were encountered:
atserver_connection_free also closes the socket, which means that if you have multiple references to an atserver_connection, such as when you fork a process. Then the first call to free will disconnect and free as intended. Every subsequent attempt to use this connection will then fail as the program state thinks its connected when its not.
Generally also, you don't want to disconnect the socket until the last instance has been closed. These actions shouldn't be coupled together. The reason for this is the underlying memory that was cloned is pointed at the same file descriptor for the socket.
The TLS socket layer doesn't have this coupled behavior, only the atserver_connection code does.
Edit: actually, TLS socket layer does have this behavior, as a result of mbedtls_net_free having this behavior. Enhancement request filed with mbedtls: Mbed-TLS/mbedtls#9958
The text was updated successfully, but these errors were encountered: