-
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
-
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.