Rob
Rob

Reputation: 11798

Which protocol / technique to use for a stateful connection?

We currently have different applications that talk to each other over the network with a stateless protocol, comparable to HTTP. Many applications send messages to a single application that listens on one port only.

We now need to change this in order to have a well-defined connection from A to B, so there will be fixed ports for specific communication partners. We need to instantly get to know when the connection gets lost or established, so we can't rely on periodical checks with keep-alive messages and timeouts or similar.

What protocol or technique can I use to implement this behaviour? The whole thing is used for sending and receiving data from sensors and other devices, so there's more or less constant traffic with a relatively low average bandwith (appr. about 10 - 20 Mbit/s on a central, highly-frequented component).

Thanks for your suggestions!

Upvotes: 0

Views: 157

Answers (1)

CodeCaster
CodeCaster

Reputation: 151710

we can't rely on periodical checks with keep-alive messages and timeouts or similar

You have to, as TCP doesn't let you know about a broken connection until you try to read or write.

See also How to test for a broken connection of TCPClient after being connected? .

Upvotes: 1

Related Questions