Re: Implementing a network protocol
- From: Gordon Beaton <n.o.t@xxxxxxxxx>
- Date: 27 Mar 2008 09:33:41 GMT
On Thu, 27 Mar 2008 02:40:31 -0700 (PDT), Erik wrote:
The protocol itself will mostly consist of alternating question/
answer, but a client can send a disconnect message at any time, so
the client must be able to send and receive messages at any time.
If your protocol is strictly request-response with the single
exception of the disconnect message, then I would say that you can
ignore that one exception and design for the other, simpler cases. I
presume that you don't need to stop what you're doing to reply to the
disconnect, or even reply at all.
Also, what do you gain by having a special disconnect message? Both
client and server need to gracefully handle any unexpected disconnect
by the remote party anyway, even if it isn't preceded by a cheery
"goodbye". As soon as you attempt to read from or write to the socket
you'll discover that the remote has closed.
/gordon
--
.
- Follow-Ups:
- Re: Implementing a network protocol
- From: Erik
- Re: Implementing a network protocol
- References:
- Implementing a network protocol
- From: Erik
- Re: Implementing a network protocol
- From: Logan Shaw
- Re: Implementing a network protocol
- From: Erik
- Implementing a network protocol
- Prev by Date: Re: Strings, Arrays, c++ and java
- Next by Date: Re: Implementing a network protocol
- Previous by thread: Re: Implementing a network protocol
- Next by thread: Re: Implementing a network protocol
- Index(es):
Relevant Pages
|