thread's?

jorge

Junior Contributor
Joined
Jul 13, 2003
Messages
239
Location
Belgium
thread? help?

Ok, i have some code that wait for a connection,
But i'd like to do other stuff, at the same time,
So i thing thread will help me there, tell me if i'm 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:
Look in the MSDN for System.Threading namespace. Here's a short example:
Visual Basic:
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 it's not needed anymore, how? don't seen thread.stop() :(
 
Back
Top