Comments (8)
در اسناد همچنین چندین مشتری را راه اندازی می کنند: https://socket.io/docs/v4/namespaces/#client-initialization
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ممکن است بخواهید اسناد کتابخانه را بررسی کنید یا با توسعه دهنده در https://github.com/doghappy/socket.io-client-csharp تماس بگیرید
ok , thanks
from socketiounity.
in your server and in your socket connection or in an event callback
call the below line to make the client attached to a room (e.g: 'your-room')
// 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
io.in('your-room').emit("start game");
from socketiounity.
https://socket.io/docs/v4/namespaces/
How to Client initialization?
from socketiounity.
this packagee it's a Wrapper for socket.io-client-csharp, so you can look there for further info.
according to:
doghappy/socket.io-client-csharp#112
you can do like this:
client = new SocketIOUnity("http://YOUR_SERVER_ADDRESS/your-namespace", new SocketIOOptions
{
...
});
from socketiounity.
This solution creates a new socket connection, which is not ideal at all
I want to separate the application logic on a connection, for example, the login page has one namespace and the registration page has another namespace.
from socketiounity.
in the docs also they init multiple clients:
https://socket.io/docs/v4/namespaces/#client-initialization
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
https://github.com/doghappy/socket.io-client-csharp
from socketiounity.
your-namespace
io.in(my-namespace).emit("start game");
Apparently this solution is suitable, do you know how to use it in C#?
from socketiounity.
can I use Dynamic namespace in client without create new socket connection?
the Namespace property only has getter and I can't change it
from socketiounity.
Related Issues (20)
- its not working on webgl build HOT 1
- Socket not connected on IOS device HOT 3
- issues on Quest 2 headset HOT 2
- Scenemanager not working. HOT 1
- Error on serializing response HOT 5
- Can't import package and manual "import" results in errors HOT 2
- WSS support HOT 1
- Not connecting to remote server! HOT 9
- can not find a reference to assembly 'System.Memory' HOT 2
- Socket.io client connects but doesn't emit in a Unity project HOT 2
- onError not called for error return from the server HOT 3
- Include SocketIOUnity as a dependency in package.json HOT 3
- How to update Unity Editor UI after receiving data from server HOT 1
- Not work with IL2CPP HOT 8
- Socket.EmitAsync() Not working on Android Oculus Build HOT 2
- The object does not create itself. HOT 2
- No events received from socket.io v2 HOT 2
- Unconnected socket cannot be stopped (unless disposed) HOT 2
- Issues with WebGL Build?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socketiounity.