Re: receiving data with soreceive
Re: receiving data with soreceive
- Subject: Re: receiving data with soreceive
- From: Justin Walker <email@hidden>
- Date: Sat, 14 May 2005 15:42:00 -0700
On May 14, 2005, at 15:33, Bijoy Thomas wrote:
I am using SOCK_STREAM. What i am trying to do is set up a connection
with an ftp server. I call soconnect and then soreceive to get the
welcome message. I then send the username and call soreceive to get
the message asking for the passwd. Then i send the passwd and call
soreceive to get the login message. Each time, the data send by the
server varies.
Since you are using SOCK_STREAM, you should be aware that there is
*nothing* in the definition of either SOCK_STREAM or TCP that
guarantees anything like message boundaries. This means that your
application (or your kernel code) has the responsibility to make sure
that you have received all the data you expect; nothing in the kernel
will do that for you.
Using MSG_PEEK is probably the best way to look at what is currently
queued, but you still have to watch out for the Perils of Poling :-}
Regards,
Justin
--
Justin C. Walker, Curmudgeon-at-Large
/~\ The ASCII
\ / Ribbon Campaign
X Help Cure HTML Email
/ \
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden