tcp connection with timeout

kamiseq <>
Wed Oct 14 18:54:03 CEST 2009


hi,
is there a way to discard any message from peer after set timeout occurs? A
server should respond in given time or transmission should be repeated.

I implemented small ex where one process is listening and responding in
random time (let say 1 to 3 sek). and it is always accepting exactly one
process during its life.

other process is connecting via tcp and is sending msg. I set send_timeout
flag for socket and a timer on receive after to let say 500ms and 1000ms so
it should get timeout all the time.
when I receive timeout I send special msg that server should repeat last
response. all this is great but then I will receive two responses from
server with timeouted and then repeated msg.

in fact Im receiving all "lost" messages that were sent to my client by
server. I could maybe add some ticket to the msg and take out any incoming
messages that are not matching but this is impossible right now (afac) as I
will break protocol.

-- 

pozdrawiam
Paweł Kamiński



______________________


More information about the erlang-questions mailing list