The libreary uses peer handles as socket handles, this causes major issues.
The module reuses peer handles imediatly after closing them, often only twice before incrementing for some reason.
Sockets are always closed by reciving a EDM_URC disconnect event. This causes all closes to be through ShutdownForWrite.
This means even if a socket is closed, it will excist in the set untill the timeout is reached(15 sek). If a new socket is created and connected, you will have 2 with the same handle. This causes a close to only change the first(old) one, leaving the second(new) one in the state Connected or WaitingForConnection in the socketset.
This also causes crossover during connection, as the state of the old socket is read, and connect is exited before an EDM_URC has arrived
The libreary uses peer handles as socket handles, this causes major issues. The module reuses peer handles imediatly after closing them, often only twice before incrementing for some reason. Sockets are always closed by reciving a
EDM_URC
disconnect event. This causes all closes to be through ShutdownForWrite. This means even if a socket is closed, it will excist in the set untill the timeout is reached(15 sek). If a new socket is created and connected, you will have 2 with the same handle. This causes a close to only change the first(old) one, leaving the second(new) one in the stateConnected
orWaitingForConnection
in the socketset. This also causes crossover during connection, as the state of the old socket is read, and connect is exited before an EDM_URC has arrivedAn example is shown below:
As it requires one empty space in the set, it can never lock the set, as it will leave one open space.
This is recreatable by creating a connection to anywhere, closing it, and creating a connection to the same place again.
Solution
Decouble Peer handles and socket handles, in the same way peer handle and channel id is set up.
Alternative
Close any sockets with the same peer handle, as they do not match the modem state anymore. This is quite an easy fix.