Well...
Speaking out of experience I do also have to call the Close routine from
the Winsock Control, otherwise the connection stays up in a kind of
tristate: State = tcpClosing.
BTW: Why should the docs state '... to correctly close ...' the
connection when documenting the Close Event.
I've also noticed that invoking the Close routine doesn't raise the
Close Event at all.
Sinna
All,
Thanks for all your help! But I still haven't managed to get to the
bottom of this problem, so any more feedback would be welcome. I tried
a number of suggestions, but none of them worked, so I've written a
'work around'.
In the end I pass '<end>' at the end of the string of records at the
server, and now test for this in the global variable Data, in the
close event. If it's not present, then i request the entire data, from
scratch, again. It's not perfect, but it does seem to work!
For your information, I've noticed the following.
1) Some times the last DataArrival event does not always contain the
entire last chuck of data sent from the server, and the Close event
will fire. Now from what some of you said the next DataArrival event
that occurs should contain the missing data, but it never does!
2) I've noticed that during normal office hours the problem's occur,
more frequently than outside!
3) On the server side I have PHP file that is uses an ODBC driver to
run a SQL query to get the record's I required, and then pass then back
to the client app, written in VB6, to displayed in an MSFlexGrid.
Rob
Thorsten Albers - 22 Jan 2007 16:24 GMT
RobertTheBruce <robert_bruce@hargreaveslansdown.co.uk> schrieb im Beitrag
<1169470447.438816.192830@m58g2000cwm.googlegroups.com>...
> 1) Some times the last DataArrival event does not always contain the
> entire last chuck of data sent from the server, and the Close event
[quoted text clipped - 7 lines]
> run a SQL query to get the record's I required, and then pass then back
> to the client app, written in VB6, to displayed in an MSFlexGrid.
As far as I can see your PHP script closes the connection as soon as it has
sent the last data packet. I don't know anything about the machine on which
you PHP script runs - but maybe this closing prevents the remaining data
which are still in the queue from being sent. Instead try this:
- After PHP has sent the last package of data it should enter a kind of
'listen mode' and wait for an acknowledgement of you VB application that it
has recieved all data. If the acknowledgement isn't received within a
certain time interval, the PHP script should close the connection terminate
with an error. If it got the receipt it should close the connection and
terminate successfull.
- You VB application should acknowledge the receipt of all data by sending
the PHP script a certain data sequence ('<ack>' or the like). If it hasn't
recieved the data within a certain time interval it should close the
connection and terminate with an error.

Signature
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------