Saturday, July 27, 2019

How do applications receive and send data specific to their application?

Sorry if I've asked this before but I don't think it's getting across.

Ok, so ports are used to specify what application level protocol should be used when TCP data packets are sent to - but say if you made a P2P game where both players had there own map loaded, and all they needed to know to play with one other player was there position relative to the map and update it, what would a programmer need to code in order to send his position on the map to the IP address of the other player, and receive the position of the other player - let's say in an integer list (x, y, z).

I really have no idea how this would be done, protocols are just concepts so would you have to code literally each protocol from scratch, and how would once the packets be received, the computer know what to do with it (application layer protocol) - there is no port to specify immediately how the computer should deal with it, so how would you specify in the packet once received send the data to this application - and how would you code that; like position = TCP.receive(x,y,z); or something?



No comments:

Post a Comment