    001package net.minecraft.network;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import java.net.SocketAddress;
    006import net.minecraft.network.packet.NetHandler;
    007import net.minecraft.network.packet.Packet;
    008
    009public interface INetworkManager
    010{
    011    /**
    012     * Sets the NetHandler for this NetworkManager. Server-only.
    013     */
    014    void setNetHandler(NetHandler nethandler);
    015
    016    /**
    017     * Adds the packet to the correct send queue (chunk data packets go to a separate queue).
    018     */
    019    void addToSendQueue(Packet packet);
    020
    021    /**
    022     * Wakes reader and writer threads
    023     */
    024    void wakeThreads();
    025
    026    /**
    027     * Checks timeouts and processes all pending read packets.
    028     */
    029    void processReadPackets();
    030
    031    /**
    032     * Return the InetSocketAddress of the remote endpoint
    033     */
    034    SocketAddress getSocketAddress();
    035
    036    /**
    037     * Shuts down the server. (Only actually used on the server)
    038     */
    039    void serverShutdown();
    040
    041    /**
    042     * returns 0 for memoryConnections
    043     */
    044    int packetSize();
    045
    046    /**
    047     * Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to
    048     * stop reading and writing threads.
    049     */
    050    void networkShutdown(String s, Object ... var2);
    051
    052    @SideOnly(Side.CLIENT)
    053    void closeConnections();
    054}