Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Winsock control?
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Winsock control?
Miscellaneous
Thread ID:
00846736
Message ID:
00846736
Views:
63
Having a problem with VFP8 and MS Winsock Active X.

We have an application where a sever program runs and multiple clients can attach to it via the winsock control. The clients send a connection request to the server and the server creates a new winsock object for each client to use. The clients can talk to the server and the server can send data back to the client just fine.

One of the functions the server has is the ability to broadcast data to all the clients at once. This has created a problem for us.

To broadcast a message we loop through all client winsock objects and send our message to all of them, but only the first client receives the message. All the remaining winsock objects fail to send their message and instead store it in a buffer which will not flush until another transmission occurs from the client.

For example, if we have two clients attached to the server and the server broadcasts the message "Hello World", the first client will receive "Hello World" just fine, but the second will not. However, if we press a key on the second client (thus sending more data through the winsock), it will then receive the "Hello World" message.

After working with this problem for awhile we found that this only occurs when you attempt to send data to multiple winsocks in rapid succession. If you create a wait state in between the SendData for each winsock it will work fine ('Messagebox', 'DoEvents Force', and 'Wait "" Timeout .1' all work). However, this slows the program down to an unusable level.

Toggling AutoYield doesn't help the problem either.

We've reproduced the application using VB.NET and it works fine, so we assume that it is a problem with the way VFP handles the winsock active x.

Does anyone have a solution to get around this problem without the slow wait states, and does anyone know if this issue will be fixed in the next version of VFP?

Thanks,
Dale
Next
Reply
Map
View

Click here to load this message in the networking platform