CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Location
    Detroit
    Posts
    6

    TCP listener on a thread wont stop

    Hey, I'm trying to set up a tcplistener on a different thread so i can still use my app while i wait for an incoming connection. However, If exit the application before the connection is established, the listener thread keeps running. How do I make the application kill the thread when it exits. I've tried Thread.Stop() but it didn't work


    Thanks in advance

  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    Do THREAD.ABORT()

    -Cool Bizs

  3. #3
    Join Date
    Apr 2003
    Location
    Detroit
    Posts
    6
    oops, thread.abort is the right command. That did the trick, but there was something else I had to do to make it stop. I was dimming the tcplistener from within the sub, and i couldnt stop it from the other sub.

    so just a note to anyone else trying the same thing and having problems., dim the tcplistener from outside the subroutine. easier to stop that way


    thank for the help coolbiz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured