Class NetworkManager

  extended by com.hdcookbook.grin.util.NetworkManager

public class NetworkManager
extends java.lang.Object

This class runs a thread that is used for communicating with a server via a socket. It accepts requests for network activity on the enqueue() method, which queues the request for execution on the networking thread. It then performs the request on the networking thread. If used with GRIN, it is expected that the response data will be packaged as a GRIN command, for later execution back in the animation thread.

Constructor Summary
Method Summary
static void enqueue(java.lang.Runnable r)
          Queue the runnable to run in the networking thread.
static void shutdown()
static void start()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public NetworkManager()
Method Detail


public static void start()


public static void shutdown()


public static void enqueue(java.lang.Runnable r)
Queue the runnable to run in the networking thread. When the Runnable executes, it should regulary check Thread.isInterrupted, and return if it finds the thread has been interrupted.

See Also: