I have a quick question about how the TCP Stream class works.
At the moment, it's doing what I was expecting, which is reassembling tcp streams so I can gather up all the parts of say, a large png file that is part of an http request / response.
What I'm not sure however, is how the library will behave when there are multiple http requests and responses going over the network. For example if someone tried to load several pages at once.
Would we get a situation like the following (imagine this is a flow of packets coming back through the stream callbacks and being fed into my code):
[ Request URL # 1]
[ Request URL # 2]
[ Request URL # 3]
[ Response to URL # 1 part 1]
[ Response to URL # 1 part 2]
[ Response to URL # 1 part 3]
[ Response to URL # 2 part 1]
[ Request URL # 4]
[ Response to URL # 2 part 2]
[ Response to URL # 3 part 1]
[ Response to URL # 3 part 2]
[ Response to URL # 4 part 1]
[ Response to URL # 4 part 2]
[ Response to URL # 4 part 3]
Which would be awesome. Now I'm pretty sure this would happen if the multiple requests were all sent to the same server, but if not, is something like this likely to occur:
[ Request URL # 1 at server A]
[ Request URL # 2 at server B]
[ Request URL # 3 at server C]
[ Response to URL # 1 part 1]
[ Response to URL # 2 part 1]
[ Response to URL # 3 part 1]
[ Response to URL # 1 part 2]
[ Response to URL # 1 part 3]
[ Response to URL # 2 part 2]
[ Response to URL # 3 part 2]
[ Response to URL # 4 part 1]
[ Response to URL # 4 part 2]
Where server B starts sending back his data before server A has finished sending the rest of the packets for the first request there. How would libtins handle that? From what I read about the StreamFollower the idea is it will separate out the different TCP streams (and I would think that is based on ip and port number etc), so would each server get it's own TCP Stream somehow? And if so how is that implemented in the code?
If not, I suppose I'll need to write my own code to check on the source and destination ip and port numbers and figure it all out myself!