
winsock control: buffer flushing?
Quote:
>I try to make an SMTP-client. It seems that every SMTP-command has to be
>individually accepted by the server. Now when I try the following sequence:
>winsock.senddata "Helo mail.own.fi"
>etc.
>it seems that all the stuff goes to TCP-buffer and it is sent as one packet
>instead of three (or more...) separate packets.
>So, the question is: How can I force winsock to send data - one line - one
>packet? Or is there a way for that?
This is the way that TCP sockets work. They are "stream" sockets, which
means that all you can guarantee about transmission is that the packets
will arrive in order. A single send may be broken up into more
fragments, or several sends may be combined. It is possible to tell the
socket stack not to hold short packets awaiting further packets, but
doing so is generally not advised, and will usually have the effect of
_reducing_ the transfer speed of your program - not what you want, at
all.
It's important for you to use the other aspects of SMTP that make it
workable over TCP - each command gets a response, so you should send the
command, then wait for the response before sending the next one.
Otherwise, you may be sending a command that is not allowed, due to the
failure of a previous one.
Note also that you do not show the <CR><LF> sequence being sent - does
your senddata function do this? If not, you will have to include these
characters in the data sent.
Alun.
~~~~
---
Texas Imperial Software | Try WFTPD, the Windows FTP Server.
1602 Harvest Moon Place | Available at the web site
Cedar Park TX 78613 | http://www.wftpd.com
Phone +1 (512) 257 2578 | Now accepting credit card orders!
===================================================================
***** WFTPD Pro, an NT Service FTP Server supporting multiple *****
** simultaneous virtual hosts, is now available for $80 per copy **