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