I did some experiments with the flag TDI_SEND_AND_DISCONNECT, the comment in
the include file says “Piggy back disconnect to remote and do not indicate
disconnect from remote” When setting this flag in the last send will the FIN
be included in the last data packet however disconnect event will not be
called as the comment in the include file hints. The problem with this is
that I don’t know when I can close the socket since I normally wait for an
event that is set from disconnect event handler, if not waiting for this the
last data sent is sometimes lost.
This flag is set by TransmitFile() if given both the flags TF_DISCONNECT and
TF_REUSE_SOCKET, in this case the socket is not closed but reused, parhaps
TDI_SEND_AND_DISCONNECT can only be used when reusing the socket?
Hitta rätt på nätet med MSN Search http://search.msn.se/