For the past week or more I have been struggling to find out why AOL was disconnecting me after making a connection to a second BOS server for additional services. The main BOS server would disconnect without any notice (connection reset by peer) when sending it any packets after connecting to and setting an additional connection.
This morning I was again looking into the issue and I was looking at a wireshark dump and it hit me: sequence numbers! I thought for sure AOL wouldn’t be strict about their sequence numbers, but after some testing it appears that is quite true. What was happening was I was sharing the FLAP sequence number among all connections, so by the time I had completed the sequence of commands on the additional connection, the shared sequence number had been increased quite a bit. So by the time I send another FLAP packet on the first/main connection, AOL decided it lost some packets judging by the difference between the last sequence number it received and the one contained in the current FLAP packet.
What I can’t understand is why they don’t send a FLAP error packet that would have easily highlighted the actual problem instead of forcefully severing the connection.
So a word to the wise: make sequence numbers connection-specific and (obviously) increment them only by 1 for each FLAP packet sent.
Lastly, as a quick update: I’ve got most of the basic functionality down and am now working on chat, file transfer, and direct connections.