Re: receiving data with soreceive
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On May 14, 2005, at 15:33, Bijoy Thomas wrote: 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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 :-} This email sent to site_archiver@lists.apple.com
participants (1)
-
Justin Walker