system.messages
Class MessageUtil

java.lang.Object
  extended by system.messages.MessageUtil

public class MessageUtil
extends java.lang.Object

Some utility functions to help manage network communications between Tasks.

Author:
sean

Constructor Summary
MessageUtil()
           
 
Method Summary
static NetworkMessage getMessage(java.nio.channels.SocketChannel channel)
          Read a NetworkChannel from the SocketChannel.
static void sendMessage(java.nio.channels.SocketChannel channel, NetworkMessage message)
          Send a NetworkMessage packet onto the given SocketChannel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageUtil

public MessageUtil()
Method Detail

sendMessage

public static void sendMessage(java.nio.channels.SocketChannel channel,
                               NetworkMessage message)
                        throws java.io.IOException
Send a NetworkMessage packet onto the given SocketChannel.

Parameters:
channel -
message -
Throws:
java.io.IOException

getMessage

public static NetworkMessage getMessage(java.nio.channels.SocketChannel channel)
                                 throws java.io.IOException
Read a NetworkChannel from the SocketChannel.

Parameters:
channel -
Returns:
Throws:
java.io.IOException