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