Hi there:
I am writing a program to implement both voice and text chat(voice and text data are mixed) among several computers via one UDP link. Both the voice and text data are variable length. The problem is that package(voice or text data) maybe be segemented through network before reaching the destination, and the arriving sequences of segemented package from different sources are unpredictable. How should I design the message structure or communication model?
Just like yahoo messenger, people can talk using Microphone and speaker of computers and at the same time, they can chat by inputing something using keyboard. If I send a voice package about 2Kbytes, there is 2 fields in the header of the package(the TYPE is voice, the SIZE of this package is 2K). But in the destination, this package maybe be segemented into several packages.Except for the package with header, I don't know the other packages whether they are voice or text packages.
Thanks a lot.
I am writing a program to implement both voice and text chat(voice and text data are mixed) among several computers via one UDP link. Both the voice and text data are variable length. The problem is that package(voice or text data) maybe be segemented through network before reaching the destination, and the arriving sequences of segemented package from different sources are unpredictable. How should I design the message structure or communication model?
Just like yahoo messenger, people can talk using Microphone and speaker of computers and at the same time, they can chat by inputing something using keyboard. If I send a voice package about 2Kbytes, there is 2 fields in the header of the package(the TYPE is voice, the SIZE of this package is 2K). But in the destination, this package maybe be segemented into several packages.Except for the package with header, I don't know the other packages whether they are voice or text packages.
Thanks a lot.