Events are the triggers for the methods to be invoked. An example of an event is a mouse click. The events from other objects such as a command button are used to trigger some of the methods listed above. The Winsock Control generates events that also may be used. Some of these events such as the ConnectionRequest event happen at the server system as a result of an action at the client system. The events generated by the Winsock Control make it possible for an unattended system to participate in a network communications session.
Close Events
This event occurs when the remote computer closes the connection. The event can be used to do cleanup work at the end of a session.
The syntax is:
Private Sub MyWinsockControl_Close()
Connect
This event occurs after the connection with the remote computer has been made.
The syntax is:
Private Sub MyWinsockControl_Connect()
ConnectionRequest Event
This event occurs when the server receives a request for connection from a client system.
The syntax is:
Private Sub MyWinsockControl_ConnectionRequest(requestID As Long)
DataArrival Event
This event occurs when new data arrives.
The syntax is:
Private Sub MyWinsockControl_DataArrival (ByVal bytesTotal As Long)