--- In [email protected], "Indika Bandara" <[EMAIL PROTECTED]> wrote: > > hello, > i want to develop a application layer protocol to send > particular data (a file and some other text). how can > i start with this.
Collect all your requirements, and then define an overhead protocol to fulfil all these. But you have to collect them all first. > my program can read(), write() with socket. i want to know > how can i implement reliabiltiy and other constraints i > have to look at. That depends on the underlying protocol, see next paragraph. > for example i can send the file to the other end with > write() and read() from there. but is that all? can some > packets get lost (using TCP sockets) and is there a limit > to the bytes in read() , write() once. Using TCP/IP: no; TCP/IP makes sure that either every TCP packet arrives in the correct order or that nothing arrives at all. There is no such thing as a partial delivery with TCP/IP. TCP/IP is a connection oriented protocol and takes care of such measures on its own. Using UDP/IP: yes; UDP is more of a broadcast protocol, it's not connection oriented. Regarding the maximum number of bytes per transfer in read() or write(): I don't know of any general limitation except the range of valid numbers in size_t; but of course there may be implementation specific limitations. In general I would suggest not to use more than a few MB per single transfer; chances are too high that a short network dropout will kill the packet. Regards, Nico To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/c-prog/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
