Re:Considerations when designing a TCP/IP protocol
Quote
"Kirsten" <kirs...@no-spam.com> wrote in message
news:91t0h4$k3t4@bornews.inprise.com...
Quote
> I need to design a simple protocol to exchange some information between
the
> server and workstation using the tcp/ip protocol as the base. What
> considerations should I have when designing it ?
Well, a good place to start might be to look at how the common protocols
have been designed. E.g. search for POP3 over at http://www.rfc-editor.org
and you'll notice that:
- all commands are issued as text. Advantage: Easy to test using plain ol'
telnet, meaning you can actually test a server implementation without
writing one line of client code. Downside: more parsing work for your
command interpreter
- all text commands have a fixed length (4 characters max in both SMTP and
POP3) making parsing slightly easier
- when transferring large blocks of data, either indicate max number of
bytes (look at Indy's WriteStream implementation which'll write the stream
size ahead of the stream unless ordered not to do so) or end the
transmission with a terminating sequence (single dot alone on a line in the
case of POP3 / SMTP).
- try to avoid small (and numerous) data packets if possible
--
Rune