mafrasi2
mafrasi2

Reputation: 322

How can I send various information on one socket?

I want to write an application for my android phone to control it via wlan. That should contain its camera abilities.

Is there any elegant method to send live pictures and other information in one socket "at the same time"? My idea is to let the server accept more than one client: the first for life images, the second for information, third for audio streaming...

It should work like skype: you can call people and chat at the same time with one connection. How can I implement something like that?

Upvotes: 1

Views: 123

Answers (1)

Matti Virkkunen
Matti Virkkunen

Reputation: 65126

I doubt multiple sockets would do you any good (unless Android makes it really hard to put data from multiple sources into the same stream). Just send everything sequentially in the same stream, with a tag in front to identify each type of data. The fancy name for this is "time-division multiplexing".

Multiple sockets might make sense if you get into fancy tweaking to, say, give more priority to realtime streams, but I have a feeling that shouldn't be necessary.

Upvotes: 3

Related Questions