What I need to happen with a VB6 application I maintain is the following.
- Establish a connection to a known address and port over a Ethernet network.
Send a request
Wait for a response.
I tried using WinSock and Winsock replacement but they all rely in one form or another the messaging loop inherent in various Windows application. I don't know enough about the Winsock API how to implement the above algorithm in VB6 (or in any other language.
My application is a VB6 CAD/CAM software that controls metal cutting machines over a dedicated Ethernet network. The software has been maintain for 20 years and we developed several driver for different types of motion controllers. To date the API for these motion controllers consist of
- Opening a connection to the hardware
- Sending a request to the hardware (for example Position of an axis)
- Waiting for a response (usually occurs in milliseconds).
Some of these controller work over a Ethernet Network but until now I never had to directly interact with the ports. I used the company supplied libraries to handle things. And they work in the way I mentioned above and throw a timeout error if a response doesn't occur in some defined time.
The problem with Winsock is that I have to insert DoEvents to get it a respond. This causes havoc with how we handle multi-tasking in our VB6 application. The replacement like CSocketMaster use subclassing which also cause havoc with our multi-tasking.
So any help on how to use the Winsock API or a third party dll that can do what I need to do as outlined above. I wouldn't be asking if I haven't seen other motion control do what I want to do.
TCP_NODELAY
works. – deblocker