3

I am trying to connect multiple clients to the server where all the connected clients get the same data from the server. Something like the clients can subscribe to a service and get the same data from the server.

I have tried connecting multiple clients to the server and send a stream of incrementing numbers. It works fine but when a new client enters it should start from the old client receiving the same data.

the server streaming messages:

 def str(self, request, context):

        digit = 0
        m = 'Turn'
        print('Message Type:, %s!' % request.type)
        if request.type == 'Streaming':
            while True:
                direction = m
                    #digit = random.randint(0,100)
                digit+=1
                yield text.Response(message='Move, %s!' % direction,dir=a)

I want to multicast this message to multiple connected clients

murgatroid99
  • 19,007
  • 10
  • 60
  • 95
  • 1
    When you say that a new client should "start from the old client receiving the same data", do you mean that new clients should start getting the beginning of the stream, or the current point in the stream that older clients are receiving? – murgatroid99 Sep 04 '19 at 17:39

0 Answers0