winsock and multithreading
Hi,
Just to confirm.
I have written a server application which creates 10 winsock controls Dynamically. Therefore allowing 10 clients to connect to it.
I have only coded for the DataArrival event once (as I only have one winsock object on my form) and within this DataArrival event I call a function which Processes the Data recieved from the client. I do use the index of the winsock and pass it to the 'ProcessData' routine to know which one of the 10 winsock called the 'ProcessData' function so I can send back a message from the 'ProcessData' function telling the client the data recived was Ok or not.
In process Data I connect to a DB and do stuff aswell as reply back to the calling winsock.
What I would like to confirm is every time a client connects does VB6 create a new thread for that process. Meaning even though my Process Data function has only been written once will there be multiple instances of it running and running at the same time depending on how many winsocks data arrival events called it.
I have restriced the usage of Global Vars, as this may be effected if the above is true.
Can some one confirm for me that the above will work and that clients will not have to wait for one process to finish before there request is carried out.
Thanks in advance..