Creating the project
In VB6 you will need:
Under the components menu add a reference to MS Winsock. Place 2 Winsock controls on the form and call them WSock and PLink.
Set the index of both the Winsock controls as 0 (so that they are instantiated as an array and we can load new instances of them at runtime).
Now add a timer control called timer to the form and set the interval to 250 and enabled to false. When we receive incoming data from a PLink socket (i.e. from TRON) the timer is activated. The code for the timer event distributes the incoming data from the buffer to authenticated clients. A DoEvents command in the timer code allows new data to be added to the buffer as it arrives.
In the module add the following code:
This Type Connection declares the properties of a connection, and includes a value for the connection state, as defined by the tState type. In our web server we are going to assign a connection to each client that logs into port 255. In our main code the CN array holds an array of connections that we can use to access the properties for each connection at runtime.
No Comments for this page.