Sha256: 1f84e48fd5d5a88437aec2e53c9fdb96548c83174ecc43a25a6b2965f90c2bbb

Contents?: true

Size: 1.65 KB

Versions: 10

Compression:

Stored size: 1.65 KB

Contents

package com.toxi.net;

import java.net.DatagramPacket;

/**
 *
 * @author tux
 */
public interface ServerListener {

    /**
     * Notifies listener immediately after the server socket has been created.
     */
    public void serverStarted();

    /**
     * Notifies the listener server is shutting down.
     */
    public void serverShutdown();

    /**
     * Gives listener a chance to react to any fatal server errors.
     * 
     * @param e
     */
    public void serverError(Exception e);

    /**
     * Notifies the listener of a new server state. The state info itself is
     * attached.
     * 
     * @param s
     */
    public void serverStateChanged(ServerState s);

    /**
     * Notifies listener of a new client connection. Details are attached.
     * 
     * @param conn
     */
    public void clientConnected(UDPConnection conn);

    /**
     * Notifies listener a client has disconnected. Connection details are
     * attached.
     * 
     * @param conn
     */
    public void clientDisconnected(UDPConnection conn);

    /**
     * Notifies and forwards received client data to the listener for further
     * analysis.
     * 
     * @param conn
     *            client connection details
     * @param receivePacket
     *            data sent by the client
     */
    public void clientUpdated(UDPConnection conn, DatagramPacket receivePacket);

    /**
     * Gives the listener a chance to add extra data to the payload packet
     * distributed to each client.
     * 
     * @return additional data, or null if none required
     */
    public byte[] getSyncPayload();

}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
toxiclibs-2.0.0 src/com/toxi/net/ServerListener.java
toxiclibs-1.0.0 src/com/toxi/net/ServerListener.java
toxiclibs-0.9.3 src/com/toxi/net/ServerListener.java
toxiclibs-0.9.2 src/com/toxi/net/ServerListener.java
toxiclibs-0.9.1 src/com/toxi/net/ServerListener.java
toxiclibs-0.9.0 src/com/toxi/net/ServerListener.java
toxiclibs-0.8.0 src/com/toxi/net/ServerListener.java
toxiclibs-0.6.0-java src/com/toxi/net/ServerListener.java
toxiclibs-0.5.1-java src/com/toxi/net/ServerListener.java
toxiclibs-0.5.0-java src/com/toxi/net/ServerListener.java