Send bytes of data between two devices

Hello all,

I want to send bytes of data, like a messaging service between two devices (example: PC and an android phone). Both the device will have same application, and on receiving messages between each other, an event will be executed. How do I begin?

Thanks

You’ll want to look into a backend service. Or, just search for a messaging service sdk for Unity.

I know Unity just acquired a company for voice chat, but they also claim to have text chat.

Thank you for your reply. Not exactly a messaging service. More like communication, for example, if the host/client moves one object in the same scene, it should be reflected in both. That is the host will notify the client that certain object has been moved and so the client will execute the same thing.

Then you’ll need a multiplayer service.

Or, still use a backend service where data is shared. You could probably work something up with some sort of public user data. Example, on playfab you might be able to have one user add some key/value pair data for changes and when the person logs in, it downloads changes and moves things. But depends on how accurate you want it.

Honestly, sounds like you’ll need a multiplayer service.

How many objects need to move, how important is latency? How many people are playing this?

A few cubes, with a few people, on a few games, without latency being an issue? You can get away with a server API. Much more than this? You will want to look into multiplayer services, like Photon (I’d personally suggest Photon right now, as Unity’s own versions are transitioning). However know that multiplayer is a subject to tackle on it’s own, and will take a learning curve to get used to. Just to give you an informed choice.

Just to say though. Latency not being an issue, you could make a simple server with an API that says where ‘something’ is. I mean that’s easy enough to do, it’s just latency would definitely be a thing.

Thank you all. I have used “Forge Networking Remastered” from unity asset store and it works for my implementation. It is the best out there.

here is the link similar to what I wanted to achieve.