Skip to content

Examples

mucaho edited this page Oct 24, 2014 · 4 revisions

All examples are located in the jnetrobust.example package.

  • BidirectionalMain: This is the most basic example. Two hosts communicate with each other in an environment with ideal network conditions. They send each other String messages.

  • UnidirectionalMain: This examples demonstrates unidirectional communication between a sender that sends data and a receiver that just acknowledges the receipt of data. The impact of the emulated, bad network conditions is shown in the output.

  • SynchronizationMain is an advanced example showcasing two clients and a server communicating the position of their controlled object to each other. The communication is once again affected by emulated, bad network conditions. The server is relaying communication between the clients. Remotely controlled objects are displayed using different synchronization strategies: UPDATE_TO_NEWEST_POSITION, UPDATE_TO_ORDERED_POSITION & UPDATE_TO_RECEIVED_POSITION. Focus a window and use the arrow keys to control that host's object.

This is a screenshot taken from SynchronizationMain:

Clone this wiki locally