-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
about websocket's room #27
Comments
Hello @culionbear, how are you? I could prepare you an example right now as I use to but I am asleep and very tired at the moment, mostly because of that commit I design for several days. I will post you an example in a few hours, when I wake up, sounds good to you? |
thank you very much! : ) You really helped me a great favor! |
Hello @culionbear, A Room has a "name" which can be used to |
@kataras Thank you for your reply!(^_^) |
They can join to the same room, that's the room feature, that client can communicate through a room (in the same namespace). A Room is created per connection on its first Join, after that you can just call Above all, you can create your own custom structures to hold those kind of data in your application, see for example the "user-conn" example located at: https://github.com/kataras/neffos/blob/master/_examples/wrap-conns-to-user/main.go. I am preparing you an example, but before I proceed, take a look and tell me if this is something you want or if not please give me a code example on how you would imagine to write your websocket app's code. |
@kataras |
No worries about your english @culionbear, I am not a native english speaker too, you are totally fine. I just want to understand your use-case 100% before I push you an example. So, you want A to tell B that there is a room to join (room name = "playerAplayerB_1"), if player B accepts the invitation then A is joining to the room and so the B. If player B disconnected then A wins. If that's the case I don't see any problems here. Could you post down what is your current status of the implementation (code snippet) ? Where did you "stuck"? |
@kataras in my idea,for example,i have two service A and B,A is a normal service,B is websocket service. i "stuck" in the method called "create",i wrote a demo one year ago,but the demo has lots of bug because I don't have good control over dropped calls and timeouts. if you can speak chinese.... |
I don't speak Chinese but I used google translate to read it. I understand the use-case now. I have only one question so far, service A and service B are running on the same Iris instance, do they share the backend code or they are different servers and they should be communicate through an http client too? So, the HTTP web server (service A) should fire events to the websocket server(service B) and Service B should listen for service A in order to pass the messages to its websocket clients. Or, if they are sharing the same code, you could just use the |
@kataras |
Ok I see there are different tech envolved here, could you send me a code to work on and improve for you? Thanks, |
@kataras |
@kataras |
Ok np, so I have to write http, rpc, websocket game example and dockerize it, I will post back when I finish it. It will take some time because I am working on finalizing and relasing the new Iris version. Thanks!! Be well and take care of your health!! |
@kataras ok!no problem. |
hello
I want to implement a function with websocket.
the details are as follows:
i want to create a room and the room will return me an id.
When someone connects to service using websocket,he can via id to find the room and connect it.
How do I implement it?....
The text was updated successfully, but these errors were encountered: