A
Anders Eriksson
I wonder if there is any Design Pattern for TCP communication
Application protocol?
My application is the client. The communication is messages (Questions
and Answers) plus a KeepAlive message that is sent every 12 seconds from
both parties.
Both the server and client can start a message(Question) but can't send
a new one before an answer is received.
When a party receives a message is must send a Acknowledge message. This
must be done before the other party respond to the message.
If an Acknowledge message isn't received within 10 seconds the message
must be sent again.
The KeepAlive message must be sent and answered even if we are in a
state of waiting for an answer to a question. Not sure how to act in
case of collision (i.e. that the KeepAlive is sent simultaneously as the
Question/Answer)
So there are two "workflows"
Question/Answer
KeepAlive
They should run in parallel.
Then we have the problem with connection or rather the lack of.
How handle that connection with the server is lost?
Hopefully I have described my problem sufficient so you can recommend a
solution!
// Anders
Application protocol?
My application is the client. The communication is messages (Questions
and Answers) plus a KeepAlive message that is sent every 12 seconds from
both parties.
Both the server and client can start a message(Question) but can't send
a new one before an answer is received.
When a party receives a message is must send a Acknowledge message. This
must be done before the other party respond to the message.
If an Acknowledge message isn't received within 10 seconds the message
must be sent again.
The KeepAlive message must be sent and answered even if we are in a
state of waiting for an answer to a question. Not sure how to act in
case of collision (i.e. that the KeepAlive is sent simultaneously as the
Question/Answer)
So there are two "workflows"
Question/Answer
KeepAlive
They should run in parallel.
Then we have the problem with connection or rather the lack of.
How handle that connection with the server is lost?
Hopefully I have described my problem sufficient so you can recommend a
solution!
// Anders