473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to multi threading some IP resolving

Dear group

i im trying make a small apps there is testing the ip numbers and domains name
found in a mail header on one or more RBL servers and when doing this it is slow to
wait for one ip number to resolve before going to the next so i im thinking maybe
multi threading will make it faster, is there anyone there will help me making my
small apps to a multithread apps ?

i im a beginner and i have try to read some docs on
threading but it is to complex for me, so be nice with me :-)

this is a small sample code and not the full code (but working)
----------------------------------------------------------------------------------
Sub Main()

'dim things
Dim RBL_array() As String
Dim loop_id1 As Integer
Dim hostInfo As System.Net.IPHostEntry
Dim IPnumber As String

'puting some sample data in the array
ReDim Preserve RBL_array(8)
RBL_array.SetValue("1.0.0.127.relays.ordb.org", 0)
RBL_array.SetValue("2.0.0.127.relays.ordb.org", 1)
RBL_array.SetValue("3.0.0.127.relays.ordb.org", 2)
RBL_array.SetValue("4.0.0.127.relays.ordb.org", 3)
RBL_array.SetValue("5.0.0.127.relays.ordb.org", 4)
RBL_array.SetValue("6.0.0.127.relays.ordb.org", 5)
RBL_array.SetValue("7.0.0.127.relays.ordb.org", 6)
RBL_array.SetValue("8.0.0.127.relays.ordb.org", 7)
RBL_array.SetValue("9.0.0.127.relays.ordb.org", 8)

'turn errors off
On Error Resume Next

' looping over the array and resolve
loop_id1 = 0
Do Until loop_id1 = UBound(RBL_array) + 1

'getting the host info
hostInfo = System.Net.Dns.Resolve(RBL_array.GetValue(loop_id1 ))
IPnumber = "Not found"
IPnumber = hostInfo.AddressList(0).ToString

'put some info to con
Console.WriteLine(RBL_array.GetValue(loop_id1) & " -> " & IPnumber)

'count 1 up
loop_id1 = loop_id1 + 1

Loop

'make a break
Console.WriteLine(vbCrLf & "Hit Enter")
Console.Read()

End Sub
----------------------------------------------------------------------------------


--

Mvh
Thomas Bøjstrup Johansen

Nov 20 '05 #1
0 786

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: ajikoe | last post by:
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours,...
77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
0
by: Stuart Norris | last post by:
Dear Group, I am attempting to write a "splash" and "status" Form using a second thread. I wish to use this Form to display status information to the user when I do CPU intensive work in my...
13
by: notregister | last post by:
my program have as many as 8 threads running at a same time. can different threads open a same file at the same time? let say thread1 open a file abc.txt at the same time with thread 2, both doing...
2
by: NiponW | last post by:
Hi, I have SQL SERVER 2000 SP4 Enterprise , Windows 2003 Enterprise on Xeon 4 Processors (now with multi-threading CPU) and I have questions which seem weirds to me (used to have the same...
0
ammoos
by: ammoos | last post by:
hi friends pls help me.. i got an assignment which i feel very difficult to me.. i dont have more knowledge about multi-threading in .net... the assignment details is below.... pls help me... i...
14
by: Akihiro KAYAMA | last post by:
Hi all. I found cooperative multi-threading(only one thread runs at once, explicit thread switching) is useful for writing some simulators. With it, I'm able to be free from annoying mutual...
5
by: George Maicovschi | last post by:
As multi-threading is not built in PHP I've been using a hack letting the Apache server handle the multi-threading issues, but I'm really curious of other approaches to this issue. If anyone has...
1
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
Sorry this is so long winded, but here goes. Following the model of http://msdn2.microsoft.com/en-us/library/system.runtime.remoting.channels.ipc.ipcchannel.aspx I made a remote object using the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.