how to handle multiple user request in parallel in client/server environment ?

i'm designing the client-server system where server process(written in VB) able to handle request from multiple client process(written in VB) at the same time i.e. in parallel. so my idea is to have a server process whereby the moment it received the client request thru winsock control, it will initiate a thread(written in VB) to
1)handle that request
2)process the request
3)return the result to the client.

if the 2nd request is coming in while the 1st thread is processing the 1st request, the server process will initiate the 2nd thread to do the 3 step as above. ideally these 2 thread suppose to perform their job in parallel.

my questions are :
1)is it possible to come up with such system by using VB? if no, is there any better way of doing it?
2)if yes, how to create such thread in VB?

thank u.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I have heard that you should write an ActiveX EXE to do this. Create a new instance of the exe and pass the connection request handle to it.
swtang72Author Commented:
i'm not quite clear about your answer.can u pls elaborate that in details.
I've never done this myself, but I read about in another question. I'd explain better, but I don't know much more than I've already written.

Apparently, when your app recieves the connection request, you start a new instance of an ActiveX exe written for this purpose. Pass the connection RequestID to this exe and let it accept the connection, do all the processing and then return the value to your main app. This is about all I know, I mainly read the thread because two experts were "fighting" over the best way to do this.

Sorry I couldn't help more,
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

To my noledge you can not make maltiple treads, but there are other options.
You can execute more than one copy of the program on the computer and have them comunicate between each other, and just have multiple winsock commands on the program that interface with outher computers.

---        P3
|a|        ---
|b|        |f|
|c|        ---
|e|        P4
---        ---

P1) receives info on a, it sends it to P3 to compute the info on it and it then sends to P3 then sends on f the result

P1) at the same time receives another command and since P3 is busy it executes another copy of P3 wich is known as P4, P4 computes the info and sends result via g

a-h are all just win sock controls.

P3-P5 are all the same program they are just given a nick name once executed so as to keep the info all understand able.
P1 receives and then sends all info needed to the program.  IP number to return to, the date all that stuff.

I hope you understand my answer

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Actually, you can make multiple threads through the use of the CreateThread API, but it's apparently unstable. However, my comment on ActiveX exes will fulfil the multi-thread requirement.
swtang72Author Commented:
can u pls send me what the 2 experts talk about? may me i can get some idea of what to do.
anyway, is there any good reference to implement multi-thread by using Active X.  
I don't know what the question was called.
If you post a question for zero points with something like "AnswerTheMan and mcrider", you may be able to get their attention. Put the URL for this question as the subject and they should be able to find their way here without a problem. Those two were the experts who were discussing it.

Good luck!
(not sure if this is on the same subject)

Actually I have found the best way to do it is.
just say ya have a Winsock control.
Winsock1 is set up as an array but there is only actually "one" winsock control on the form and when recieving connection
it creat's another control and passes it on to that one mean while the first one is still recieving requests for connection or whatever.

Let me know if you want me to explain
That's an easy thing to do, but it apparently doesn't allow the connections to be parallel. That's why I mentioned the ActiveX exe method.
swtang72Author Commented:
Dark Angle,
does yuor answer similar to what mikeTmike said?

which part of my system proposed would be the Active X control?
mikeTmike's answer is closer to mine than Dark Angel's.

This is basically what I had in mind:

Your app recieves a connection request.
It passes the requestid to the activeX exe.
ActiveX exe accepts the connection and does the processing.
Value returned to main app.

Main app:

Sub Winsock1_ConnectionRequest(RequestID as Long(?))

'Start new instance of ActiveX exe and
'pass RequestID to it. ActiveX should
'be coded to return the value from the connection.

End Sub

I don't know how to start the new instance, but I think it's something like "Dim NewConnect As New ActiveXApp". I don't know how to pass the value to it, but it's probably just a simple function call. I don't know how to return the value except as a normal function return value but that would probably result in linear execution. :-( I wish I knew how to do all this, because I have some good uses for it.
mikeTmike's answer would probably work like you want if you can get it written.
I currently have something in a standart EXE file that use winsock to download urls and analyse the data. Can I move that to an activeX exe and call the exe from my program to make it run the activeX file more than one at the time ?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.