io.nadron.client.communication.MessageSender Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nadclient Show documentation
Show all versions of nadclient Show documentation
This is a client library for Nadron server https://github.com/menacher/java-game-server/tree/netty4/nadron. Java clients can use this program to connect and interact with nadron server.
package io.nadron.client.communication;
/**
* This interface declares method for sending a message to client. Different
* implementations would be used by the server for sending based on the delivery
* guaranty that is required.
*
* @author Abraham Menacherry
*
*/
public interface MessageSender
{
/**
* This method delegates to the underlying native session object to send a
* message to the client.
*
* @param message
* The message to be sent to client.
* @return The boolean or future associated with this operation if
* synchronous or asynchronous implementation respectively.
*/
Object sendMessage(Object message);
/**
* Returns the delivery guaranty of the implementation. Currently only
* RELIABLE and FAST are supported, their respective integer values are 0
* and 1.
*
* @return The guaranty instance associated with the implementation.
*/
DeliveryGuaranty getDeliveryGuaranty();
/**
* Cleanup hook which can be called when a session is disconnected or
* closed.
*/
void close();
public interface Reliable extends MessageSender{}
public interface Fast extends MessageSender{}
}