c++ - Should I listen on different ports, or the same port? -
i'm writing c++ application mymasterapp (windows & mac) listening bunch of information coming different computers , applications. (osc via udp)
i.e. mymasterapp listening tracking data coming number of tracker applications (which may or may not running on same computer, on same wired network). it's listening orientation data coming number of other applications (running on mobile devices, on same wifi). apps sending @ 30hz.
so:
/tracker/position1/[f] [f] [f]
/tracker/position2/[f] [f] [f]
/tracker/position3/[f] [f] [f]
/mobile/orientation1/[f] [f] [f] [f]
/mobile/orientation2/[f] [f] [f] [f]
/mobile/orientation3/[f] [f] [f] [f]
i'm wondering whether there difference (in network performance, collisions etc) if:
mymasterapp should listen messages on port 8000, , tracker apps, , mobile apps send port 8000
vs
mymaster listens to tracker messages on port 8000, , mobile messages on port 9000.
both seem work fine, i'm wondering if there performance advantage of 1 on other, or rule of thumb 1 use. re there theoretical, or recorded practical advantages of 1 on other? or differences negligible?
i have related network performance question same project @ multicasting big packet contain info multiple clients vs individual packets targeted clients
the real difference in code: whether easier decode different protocols using different sockets or whether overhead negligible.
Comments
Post a Comment