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
When a socket's peer address is set or changes after the socket has been associated with a network interface, that socket will never be disassociated from the network interface, which will cause the socket to stay in memory and won't make the socket's port available for other sockets.
For example:
socket() - the application creates a new UDP socket
bind() - the application binds the socket to some address; the socket is associated with the network interface using the key: <ip>:<port>|0:0
connect() - the application sets the peer address of the socket
close() - the socket is closed; the socket is disassociated from the network interface using the key <ip>:<port>|<peer_ip>:<peer_port>, but this key doesn't exist so the disassociation silently fails
the socket remains associated with this interface until the end of the simulation
I think this is also an issue for client TCP sockets that are manually bound (bind() called before connect()).
The text was updated successfully, but these errors were encountered:
stevenengler
changed the title
Some UDP sockets are never removed from the network interface
Some UDP sockets are never disassociated from the network interface
Dec 7, 2022
stevenengler
changed the title
Some UDP sockets are never disassociated from the network interface
Some sockets are never disassociated from the network interface
Dec 7, 2022
#3009)
The purpose of the handle is to make it harder to accidentally forget to
disassociate the socket, to have multiple associations, or to
disassociate a different socket address than what was originally
associated. For example when re-associating a socket with another
address. See for example #2590. This could be made nicer if the network
interface was in rust, but I think this is good enough for the time
being.
This is fixed now for UDP sockets due to #2981, and should hopefully be prevented in the future due to #3009. We can probably close this once we use the AssociationHandle for TCP sockets.
When a socket's peer address is set or changes after the socket has been associated with a network interface, that socket will never be disassociated from the network interface, which will cause the socket to stay in memory and won't make the socket's port available for other sockets.
For example:
socket()
- the application creates a new UDP socketbind()
- the application binds the socket to some address; the socket is associated with the network interface using the key:<ip>:<port>|0:0
connect()
- the application sets the peer address of the socketclose()
- the socket is closed; the socket is disassociated from the network interface using the key<ip>:<port>|<peer_ip>:<peer_port>
, but this key doesn't exist so the disassociation silently failsI think this is also an issue for client TCP sockets that are manually bound (
bind()
called beforeconnect()
).The text was updated successfully, but these errors were encountered: