Sim-eth-es TCP or UDP?

Couldn’t really find definitive information, so a quick question - does Sim-eth-es use TCP or UDP ?

And it’s only one port right (and multiple channels) ?

As far as I know, it uses TCP for all entity component updates. But for applying the players view directions which is sent continuously UDP is used.

1 Like

Tcp is guaranteed to get delivered. Udp is not, and is used for movements and what not that get sent like a machine gun.

1 Like

That would explain the difference I see between entity updates and updates to the player… I’ve wondered for a long time why that was. Great.

But it’s on the same port then (both TCP and UDP) ?

Ah. Good to know.

Yeah, should be!

I think it is the same port in pauls example code, but it does not have to be. In my implementation if memory serves, i just have another overload on the connectionState constructor for int tcpPort, int udpPort but i cant really see a reason why you would want seperate ports. There’s no benefit i can think of.

Ill also leave this here because knowledge is power.

https://www.google.co.uk/url?sa=t&source=web&rct=j&url=http://www.mrc.uidaho.edu/mrc/people/jff/443/Handouts/Ethernet/Specific%20Protocols/TCP%20vs%20UDP%20-%20Difference%20and%20Comparison%20_%20Diffen.pdf&ved=0ahUKEwji6L2Mjs_VAhWBAcAKHVcRDygQFggyMAI&usg=AFQjCNGl_P6X4rUvEWz1IM_SOubybEz10Q

As others have stated, it uses both.

SimEthereal, the library, is using UDP and a custom protocol on top of that to present reliable object state transfers. Its protocol is better than TCP because it knows it can throw away old state, etc… It’s optimized for object syncing, only sends changes, keeps data grouped into frames, etc…

Most of the rest uses TCP unless otherwise stated. For example, in the RPC mechanism there is a way to call a method as unreliable and asynchronous… this would use UDP. I don’t know if Sim-eth-es uses that annotation or not. Pretty sure not.

And yes, the UDP port is configurable in your code. The SimEthereal library just uses whatever you’ve setup in your Spider Monkey network connection… and there you can give a different port to both.

http://javadoc.jmonkeyengine.org/com/jme3/network/Network.html#createServer-java.lang.String-int-int-int-
http://javadoc.jmonkeyengine.org/com/jme3/network/Network.html#connectToServer-java.lang.String-int-java.lang.String-int-int-

1 Like

Ahah… cool. Yeah, the move information is blasted once per frame and so it’s ok to drop one from time to time since the entire movement state is sent every time.