cm
Jul 13th, 1999, 05:45 PM
I have a simple server/client program set up using MS Winsock Control 2.0 and VB5. Up until now, everything has been working fine. The server has an array of winsock controls, and listens for connections on the 0-th control, then assigns connections dynamically to new controls. Nothing new there. There is also a series of commands that the server can send the client and visa versa.
Now here is the problem I'm having. Say there are three clients connected. Normally everything functions as I expect, with each client getting the proper command responses to each of its commands. However, if I ever try to send the same command to all clients (from the server), only the first client gets the command immediately. The other clients get the command only AFTER they request another command from the server, and the server replies.
So for example, if I'm running the server and I tell it to send a message to all clients like "HI"... the server loops through each active winsock control, and sends that data. However, only the first client gets the command. Clients 2 and 3 just sit there. Now, say I have client 2 send a command to the server, to which the server replies "HI" again. Now client 2 gets BOTH of the "HI" messages at once.
Does anyone have any idea why this happens or how to fix it? The problem appears to be limited to when I try to send the same data to different winsock controls from within a loop.
Thanks!
Kirk Hemmen
hemmen@badlands.nodak.edu
Now here is the problem I'm having. Say there are three clients connected. Normally everything functions as I expect, with each client getting the proper command responses to each of its commands. However, if I ever try to send the same command to all clients (from the server), only the first client gets the command immediately. The other clients get the command only AFTER they request another command from the server, and the server replies.
So for example, if I'm running the server and I tell it to send a message to all clients like "HI"... the server loops through each active winsock control, and sends that data. However, only the first client gets the command. Clients 2 and 3 just sit there. Now, say I have client 2 send a command to the server, to which the server replies "HI" again. Now client 2 gets BOTH of the "HI" messages at once.
Does anyone have any idea why this happens or how to fix it? The problem appears to be limited to when I try to send the same data to different winsock controls from within a loop.
Thanks!
Kirk Hemmen
hemmen@badlands.nodak.edu