So how do you create a group for a single user? What is the syntax like? If you have a site that opens a connection for every user. What is going to be the argument for:
Group(argument).add(message.reply_channel) Yingi Kem > On 5 Jul 2017, at 3:30 PM, Andrew Godwin <[email protected]> wrote: > > Yes, you should create a group per user. That way users with more than one > tab open will get data sent to all tabs too. > > Andrew > >> On Wed, Jul 5, 2017 at 6:42 AM, yingi keme <[email protected]> wrote: >> How will you create a web socket for a single user such that another program >> can send a json data to thesame specific user open channel. What i normally >> see is: >> >> Html script: >> >> var mysocket = new WebSocket('ws://' + window.location.host + '/users/'); >> >> routing.py: >> >> channel_routing = [route("websocket.connect", ws_connect), >> ... >> >> And finally you consumers.py: >> >> def ws_connect(message): >> Group('users').add(message.reply_channel) >> >> This is quite the norm for adding a new client to open connection list. But >> what if you want to send data to a specific client and you dont want to use: >> >> Group('users').send(json_data). As this sends to all clients on the group. >> >> Do you have to create a Group for a every user? >> >> Please i am stuck on this. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/269c3144-280e-4e65-8ab2-38a208e08dd2%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAFwN1uphRg5mLJBL48N%3DDV%3D6ryh9-du69ng90ofnGSj94803-A%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/FB1C4E26-E699-4A9A-AA5D-5E183524495B%40gmail.com. For more options, visit https://groups.google.com/d/optout.

