9 ms·
There's absolutely a scalability problem lurking there regarding ports, and what happens when you want to scan more than 21 of them.
by GFK_of_xmaspast 11y ago
There's absolutely a scalability problem lurking there regarding ports, and what happens when you want to scan more than 21 of them.
- Silhouette 11y agoHow so? The old-timer's approach would scale trivially to several times that many ports before running out of RAM on a modern PC, or many times more just by introducing a memory-mapped file. It would still be simpler and quicker to implement than the kinds of external dependencies or formal database structures being proposed by others here, and the alternatives have significant scaling concerns of their own by that point, not least if you're paying for resources like CPU, storage and network data transfer on a metered scheme. In any case, you'd probably reach a point where sparsity dictated a different choice of data structure for efficiency long before the dense representation actually broke, at which point the old-timer would most likely suggest a different solution rather than stubbornly sticking with the one that is no longer a good fit, and maybe the modern app developer would too. Realistically, there are only a few hundred major protocols whose recognised standard ports you'd want to scan assuming we're talking about TCP here, so this still looks to me like inventing hypothetical future scenarios and over-engineering to allow for unlikely future requirements.