Results 1 to 2 of 2

Thread: Sockets and Threads (??)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Posts
    5

    Sockets and Threads (??)

    Hi there,

    I've been trying to work with sockets. (which seems to be TOTALLY different then it was in VB6 ) But no problem, I've successfully created 2 working classes. 1 Client class and one Listener.

    Both working very well, but their occurs this 'problem'. While listening, there's a sort of an infinite loop being created until a client connects. Which obviously that, during this loop, means the rest of the programme freezes. I've been doing searches on this forum and I THINK that the solution is to work with "threads"... ?

    If that's the case, then the winsock control in VB6 created several threads itself ?

    What I THINK there's to do, is to create a thread that contains the "main" programme, a thread that makes the socket listen for a connection, a thread that waits for datareceiving once a client is connected....

    Can anyone provide me with some information & explanation on this "thread handling" ? ...
    Vamp

  2. #2
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    in the listener start a background thread where the infinite loop is. you wont have any problem on the client side if not creating a thread.

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