views:

23

answers:

2

I'm using the MS Winsock control in VB6 and I want to understand things like

  1. "when does the Server Close the connection (triggering the Winsock_Close() event), and a related question:
  2. How do you know when all the data from a a Post has been returned?

More info: I should have mentioned: I've already read the MSDN description, etc., but it doesn't actually explain what's happening. E.g., it explains the the Close() event fires when the Server ends the connection but doesn't explain what would cause the connection to end and whether a broken connection would trigger a Close event, etc.

And none of the MSDN descriptions explain know when all the data has arrived. (I suspect it's the Close even firing).

A: 

Documentation Lacks

The documentation will not provide the information you are asking for. This is an ActiveX control that allows you to connect computers through TCP/IP protocol stacks.

The information you want applies to how these computer "talk" (the protocol). That totally depends on the server application and client application that are communicating. For instance, if I am connecting to the FTP Service of another computer, the server will not close the connection until I send the appropriate command or until the server detects an idle connection. On the other hand, some services will close the connection on any invalid command, especially SMTP Servers will tighten security.

You need to check out the documentation of the service you are connecting with. The documentation will tell you how to send commands, command format, response codes, how commands are acknowledge, and so on.

AMissico
See my updates. I've read the MSDN stuff but it's just basic "what is this [event/method, etc.]" I need to know how it actually works.
Clay Nichols
@Clay Nichols: The documentation will not provide the information you are asking for. This is a control that allows you to connect to services through ports. How the server closes the connection will depend on the service you are connecting to.
AMissico
+1  A: 

You might want to try out the following walkthrough

tcp.oflameron.com/

You can find the complete code here


If you have any Qs in particular, plz ask here...

GoodLUCK!!
- CVS

CVS-2600Hertz