net.sf.magicproject.network
Class NetworkActor

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.magicproject.network.NetworkActor
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Client, Server

public abstract class NetworkActor
extends java.lang.Thread

This class is representating a client or a serveur, so contains nickname, connection's port and streams of opened socket.

Since:
0.2d
Author:
Fabrice Daugan

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static boolean cancelling
          Is cancelling?
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void cancelConnexion()
          cancel the join/create action, close current connections and set the main frame visible.
 void closeConnexion()
          end this server, close all connexions with connected clients
 void flush()
          flush the buffer or the current OutputStream
 void send(int... msg)
          send the specified array of int to the opponent
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cancelling

public static boolean cancelling
Is cancelling?

Method Detail

closeConnexion

public void closeConnexion()
end this server, close all connexions with connected clients


flush

public void flush()
flush the buffer or the current OutputStream


send

public void send(int... msg)
send the specified array of int to the opponent

Parameters:
msg - is the message to send

cancelConnexion

public void cancelConnexion()
cancel the join/create action, close current connections and set the main frame visible.



Copyright © 2003-2007 Magic-Project. All Rights Reserved.