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