Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about Code #24

Closed
lifeanddeath opened this issue Mar 9, 2016 · 1 comment
Closed

Question about Code #24

lifeanddeath opened this issue Mar 9, 2016 · 1 comment
Assignees
Labels

Comments

@lifeanddeath
Copy link

Hello, I was just trying to understand code but I didnt get the part where u defined NUM_THREADS variable as 16 in ScanHostAsynTask.java. why is it 16? and also String parts[] = ip.split("."); in this line what exactly does this do ? thanks in advance. my eternal respect...

@aaronjwood aaronjwood self-assigned this Mar 10, 2016
@aaronjwood
Copy link
Owner

I've defined NUM_THREADS as 16 in that part of the code because I didn't want to parallelize the work any more than that. It mostly has to do with the fact that I'm relying on ARP to scan hosts very quickly.

String parts[] = ip.split("\\."); basically splits a string into pieces using . as the delimiter. You need two backslashes so that the first one will escape the dot, and the second one will escape the first backslash. \. isn't a valid escape sequence with Java.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants