Package net.minecraft.src
Class TcpConnection
java.lang.Object
net.minecraft.src.TcpConnection
- All Implemented Interfaces:
INetworkManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int[]intstatic AtomicIntegerstatic int[]static AtomicInteger -
Constructor Summary
ConstructorsConstructorDescriptionTcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler) TcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler, PrivateKey par5PrivateKey) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToSendQueue(Packet par1Packet) Adds the packet to the correct send queue (chunk data packets go to a separate queue).voidReturn the InetSocketAddress of the remote endpointvoidnetworkShutdown(String par1Str, Object... par2ArrayOfObj) Shuts down the network with the specified reason.intreturns 0 for memoryConnectionsvoidChecks timeouts and processes all pending read packets.voidShuts down the server.voidsetNetHandler(NetHandler par1NetHandler) Sets the NetHandler for this NetworkManager.voidWakes reader and writer threads
-
Field Details
-
field_74471_a
-
field_74469_b
-
field_74470_c
public static int[] field_74470_c -
field_74467_d
public static int[] field_74467_d -
field_74468_e
public int field_74468_e
-
-
Constructor Details
-
TcpConnection
public TcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler) throws IOException - Throws:
IOException
-
TcpConnection
public TcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler, PrivateKey par5PrivateKey) throws IOException - Throws:
IOException
-
-
Method Details
-
closeConnections
public void closeConnections()- Specified by:
closeConnectionsin interfaceINetworkManager
-
setNetHandler
Sets the NetHandler for this NetworkManager. Server-only.- Specified by:
setNetHandlerin interfaceINetworkManager
-
addToSendQueue
Adds the packet to the correct send queue (chunk data packets go to a separate queue).- Specified by:
addToSendQueuein interfaceINetworkManager
-
wakeThreads
public void wakeThreads()Wakes reader and writer threads- Specified by:
wakeThreadsin interfaceINetworkManager
-
networkShutdown
Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to stop reading and writing threads.- Specified by:
networkShutdownin interfaceINetworkManager
-
processReadPackets
public void processReadPackets()Checks timeouts and processes all pending read packets.- Specified by:
processReadPacketsin interfaceINetworkManager
-
getRemoteAddress
Return the InetSocketAddress of the remote endpoint- Specified by:
getRemoteAddressin interfaceINetworkManager
-
serverShutdown
public void serverShutdown()Shuts down the server. (Only actually used on the server)- Specified by:
serverShutdownin interfaceINetworkManager
-
packetSize
public int packetSize()returns 0 for memoryConnections- Specified by:
packetSizein interfaceINetworkManager
-
getSocket
-