thread's?

jorge

Well-known member
Joined
Jul 13, 2003
Messages
239
Location
Belgium
thread? help?

Ok, i have some code that wait for a connection,
But id like to do other stuff, at the same time,
So i thing thread will help me there, tell me if im wrong.
And thread would also make it posible to pause the funtion? and restart later?

and if it is the bets way, how do i creat, stop and start a thread?

Thanx in advance
 
Last edited by a moderator:
Look in the MSDN for System.Threading namespace. Heres a short example:
Code:
Private Sub SecondarySub()
  do the stuff you want to do while waiting
End Sub

Private Sub Form_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
  Dim t As New Threading.Thread(AddressOf SecondarySub)
  t.Start()

  wait for connection here...
End Sub
 
ok, got it to work, but one problem...
I made a thread for the server, but i want to kill the tread when its not needed anymore, how? dont seen thread.stop() :(
 
Back
Top