c# - Socket and ports setup for high-speed audio/video streaming -


i have one-on-one connection between server , client. server streaming real-time audio/video data.

my question may sound weird, should use multiple ports/socket or one? faster use multiple ports or single 1 offer better performance? should have port messages, 1 video , 1 audio or more simple package whole thing in single port?

one of current problem need first send size of current frame size - in bytes - may change 1 frame next. i'm new networking, haven't found mechanism automatically detect correct range specific object being transmitted. example, if send 2934 bytes long packet, need tell receiver size of packet?

i first tried package frame fast coming in, found out receiving end sometime not appropriated number of bytes. of time, read faster send them, getting partial frame. what's best way appropriated number of bytes possible?

or looking low , there's higher-level class/framework used handle object transmission?

i think better use object mechanism , send data in interleaved fashion. mechanism may work faster multiple port mechanism.

eg:

class data { datatype, - (adio/video) size, - (size of data buffer) data buffer - (data depends on type) }

'datatype' , 'size' of constant size. @ client side take 'datatype' , 'size' , read specifed size of corresponding sent data(adio/video).


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -