The Chat class allows you to maintain a chat with another user in an easy way. You could certainly avoid to use the Chat class but you will have to manually take care of many details.
The Chat class provides many ways to get messages from the other participant.
Returns the next available message in the chat. The method call will block (not return) until a message is available.
Returns the next available message in the chat. The method call will block (not return) until a packet is available or the timeout has elapsed. If the timeout elapses without a result, null will be returned.
Polls for and returns the next message, or null if there isn’'t a message immediately available. The method call will always return immediately, whereas the nextMessage method will return only when a message is available (or after a specific timeout).
Adds a packet listener that will be notified every time a new message in the chat arrives.