-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
How to use namespaces #46
Comments
https://socket.io/docs/v4/namespaces/ |
this packagee it's a Wrapper for socket.io-client-csharp, so you can look there for further info. client = new SocketIOUnity("http://YOUR_SERVER_ADDRESS/your-namespace", new SocketIOOptions
{
...
}); |
This solution creates a new socket connection, which is not ideal at all |
in the docs also they init multiple clients: const socket = io("https://example.com"); // or io("https://example.com/"), the main namespace
const orderSocket = io("https://example.com/orders"); // the "orders" namespace
const userSocket = io("https://example.com/users"); // the "users" namespace you may want to check with the library's documentation or reach out to the developer at |
ok , thanks |
io.in(my-namespace).emit("start game"); |
in your server and in your socket connection or in an event callback // inside io.on('connection', (socket) => {...})
// or inside socket.on('im-in', data => {...}) <== but for this event to be triggered in you c# you have to call socket.Emit("im-in");
socket.join('your-room'); after this call emit when needed |
can I use Dynamic namespace in client without create new socket connection? |
Hi, how to connect to different namespaces?
I have a problem using namespaces and implementing them in the client, how to implement them in the client
Please help, any help would be helpful
Thanks
The text was updated successfully, but these errors were encountered: