A
Anders Eriksson
Hello,
I'm trying to create a client for a Client/Server application. I need some
ideas since mine are getting very complicated!
A short description of the system:
Once the connections is made both server and client may send requests.
Once a request has been sent the other party has to wait until this request
is processed before it can send a new request.
When a request is recieved an ACK must be sent to acknowlegde that the
request been received. If no ACK is received by the sending party within 10
seconds, the request is resent.
Every 14 second a KeepAlive message is sent by both server and client. if
this message has not arrived after 18 seconds the connection is reset.
a request may look like this
<STX><request>;<Id>;[<param>;[<param>;[...]]]<ETX>
My idea was to have two threads one for listening and one for writing, but
then I realize that when reading I might not get a whole request, which make
it more complicated.
I could solve it by adding a new thread but I feel that I missing something
and creating a much more complicated program than needed.
Please Advice!
// Anders
--
English is not my first language
so any error, insults or strangeness
has happend during the translation.
Please correct my English so that I
may become better at it!
I'm trying to create a client for a Client/Server application. I need some
ideas since mine are getting very complicated!
A short description of the system:
Once the connections is made both server and client may send requests.
Once a request has been sent the other party has to wait until this request
is processed before it can send a new request.
When a request is recieved an ACK must be sent to acknowlegde that the
request been received. If no ACK is received by the sending party within 10
seconds, the request is resent.
Every 14 second a KeepAlive message is sent by both server and client. if
this message has not arrived after 18 seconds the connection is reset.
a request may look like this
<STX><request>;<Id>;[<param>;[<param>;[...]]]<ETX>
My idea was to have two threads one for listening and one for writing, but
then I realize that when reading I might not get a whole request, which make
it more complicated.
I could solve it by adding a new thread but I feel that I missing something
and creating a much more complicated program than needed.
Please Advice!
// Anders
--
English is not my first language
so any error, insults or strangeness
has happend during the translation.
Please correct my English so that I
may become better at it!