Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server using Winsock on threads (Visual Basic 6)

Status
Not open for further replies.

stoorob

Programmer
Nov 27, 2000
6
GB
Hello there,

Can anyone help me with a problem I have encountered recently while writing a client/server program that allows
multiple users to log in, save\retrieve records in a SQL table and other such tasks.

Communication between the client and server is via Winsock.

The server is like :

One Winsock control for accepting user logon requests only.
Upon successfull request another winsock control (arrayed) is loaded for that request to be carried out. This Winsock handles all taks for that connection, so there coule be many Winsock in this array if more than one client logs on and performss requests.

The problem :

If the server is processing a users request and another client tries to log in or request something nothing happens until the current client's process has been finished.

Does anyone know how I can overcome this problem? I have an idea that threads may be the soluton but have never used them before. The client uses a dll to start any communication the the server, the server has the winsock contols built in to the main form - it appears that while
a process is in the DataArrival event no other data can arrive, even on another element of the Winsock array....

I have tried wrapping the winsocks into a DLL and creating each one when a request comes in but get the same result of only being able to process one request at a time! :(

Any help will be greatly appreciated.

Stuart Roberts
stoorob@hotmail.com

Cheers!!
 
Hi Stuart,

I had the same problem and, after experimenting with threads for a while, gave up.....

I ended up writing the thing in Perl to run on Linux.
Mike
michael.j.lacey@ntlworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top