Friday 15 May 2015

java - How to efficiently tie a UDP Packet to an entity -



java - How to efficiently tie a UDP Packet to an entity -

my application has made utilize of tcp connection until now, after awhile i've decided go ahead , start sending info through udp packets. application i'm working on hobbyist game project , i'm sending motion through udp packets instead of tcp packets.

the problem i'm facing efficiently linking udp packet entity, in case user.

here's current setup:

account class has uuid variable when tcp client connects, tcp server tells client it's uuid is. the uuid sent "header" udp packets when udp packet recieved server, server finds business relationship relative uuid in header, , processes logic accordingly.

the problem is, uuid big string, , isn't bandwidth friendly, utilize integer instead of string references accounts index on list<account> problem security- mean send udp packet someones business relationship index (respectively 1, 2, 3, 4, 5, 6, etc) , perform actions on business relationship using "spoofed" or false packet.

the uuid doesn't run problem, while same security issue still in effect, it's highly unlikely know users uuid.

what best way go tying datagram packet account, without involving big security risks, , without destroying bandwidth.

a uuid fits 16 bytes (two long primitives), in scheme of things don't think need concerned it's size. don't transmit string.

java sockets udp

No comments:

Post a Comment