Broadcast like UDP with the reliability of TCP

后端 未结 16 1421
陌清茗
陌清茗 2021-01-30 02:30

I\'m working on a .net solution that is run completely inside a single network. When users make a change to the system, I want to launch an announcement and have everyone else h

相关标签:
16条回答
  • 2021-01-30 03:26

    You could use a Message Broker, such as ActiveMQ.
    Publish your messages to a topic and have the clients register durable subscriptions to the topic, so that they won't miss any messages even if they are not online.

    Apache ActiveMQ is a message broker written in Java together with a full JMS client. However Apache ActiveMQ is designed to communicate over a number of protocols such as Stomp and OpenWire together with supporting a number of different language specific clients.

    Client platform support includes c# and .net

    0 讨论(0)
  • 2021-01-30 03:26

    You could implement your own TCP-like behaviour at the application layer.

    So for instance, you'd send out the UDP broadcast, but then expect a reply response from each host. If you didn't get a response within X seconds, then send another and so on until reaching some sort of threshold. If the threshold is reached (i.e. the host didn't respond at all), then report an error.

    To do this though, you'd need a pre-defined list of hosts to expect the responses back from.

    0 讨论(0)
  • 2021-01-30 03:27

    @epatel - I second the SCTP suggestion (I voted up, but can't comment yet so additional stuff here).

    SCTP has many great features and flexibility. You can sub-divide your connection into multiple streams, and choose the reliablity of each and whether it is ordered or not. Alternatively, with the Partially Reliability extension, you can control reliability on a per message basis.

    0 讨论(0)
  • 2021-01-30 03:27

    What you can do is that after the broadcast have the clients initiate the tcp connections. Otherwise you just have to keep a list of all clients and initiate the connections to each client yourself.

    0 讨论(0)
提交回复
热议问题