Message size

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

vkalpias
Posts: 56
Joined: 03 Oct 2011, 09:24

Message size

Postby vkalpias » 03 Jan 2013, 12:49

Hello,

I am trying to optimize our network messages and I was wondering if I can get a more detailed explanation on the overhead of each network message.

For instance I am sending a message to the server to synchronize a timer, which only contains a key and an empty SFS object. This is the dump of the message:

(int) r: -1
(utf_string) c: sc_t
(sfs_object) p:

Then the server responds with the same message and a long field that contains a timestamp. This message is sent using UDP and the smartfox log reports its size as 63 bytes. This seems like a lot to me because this is the message just contains a long field with a key = "t".

If I count the bytes without considering the overhead it should be close to:
key = "sc_t", size = 4 bytes
long field with key = "t", size = 8 bytes + 1 byte

This is 13 bytes total! Is the overhead of UDP 50 bytes?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Message size

Postby Lapo » 03 Jan 2013, 16:20

Try turning on the debug feature on the client(*) and server side(**) to see exactly the content of the packets.
The overhead of UDP should be pretty small.

(*) by turning on the SmartFox.debug flag
(**) by editing config/log4j.properties file
Lapo
--
gotoAndPlay()
...addicted to flash games
vkalpias
Posts: 56
Joined: 03 Oct 2011, 09:24

Re: Message size

Postby vkalpias » 04 Jan 2013, 09:11

Could you tell me what do I need to change in log4j.properties?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Message size

Postby Lapo » 04 Jan 2013, 09:16

Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 68 guests