|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.network.VoogaClient
public abstract class VoogaClient
VoogaClient is the superclass for all client classes in vooga, handling behavior that is shared across the multiple clients such as the specifics of connecting to a server.
Constructor Summary | |
---|---|
VoogaClient()
|
|
VoogaClient(java.lang.String name)
|
Method Summary | |
---|---|
static void |
allowConnection()
Invoking this method will allow any subclass of VoogaClient
from connection to the server. |
static void |
blockConnection()
Invoking this method will prevent any subclass of VoogaClient from connection from the server until
allowConnection() is called. |
void |
connect()
Connects to the server defined in the properties file by IP address. |
abstract void |
connect(java.net.InetAddress host)
Connects to the server at the specified address. |
void |
connect(java.net.InetAddress host,
int port)
Connects to the given port of the named host |
void |
disconnect()
Disconnects from the server. |
protected java.io.ObjectInputStream |
getMyInputStream()
|
protected java.lang.String |
getMyName()
|
protected java.io.ObjectOutputStream |
getMyOutputStream()
|
protected java.net.Socket |
getMySocket()
|
protected abstract void |
initializeConnection()
Performs any necessary set-up for a new connection. |
boolean |
isConnected()
|
protected void |
setConnected(boolean connected)
|
protected void |
setMyName(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
---|
run |
Constructor Detail |
---|
public VoogaClient()
public VoogaClient(java.lang.String name)
Method Detail |
---|
protected java.net.Socket getMySocket()
protected java.lang.String getMyName()
protected void setMyName(java.lang.String name)
protected java.io.ObjectInputStream getMyInputStream() throws java.io.IOException
java.io.IOException
protected java.io.ObjectOutputStream getMyOutputStream() throws java.io.IOException
java.io.IOException
public boolean isConnected()
protected void setConnected(boolean connected)
public void connect() throws java.io.FileNotFoundException, java.io.IOException
java.io.IOException
java.io.FileNotFoundException
public abstract void connect(java.net.InetAddress host) throws java.io.IOException
host
- The IP of an existing VoogaChatServer.
java.io.IOException
public void connect(java.net.InetAddress host, int port) throws java.io.IOException
host
- port
-
java.io.IOException
public void disconnect() throws java.io.IOException
java.io.IOException
public static void blockConnection()
VoogaClient
from connection from the server until
allowConnection()
is called.
public static void allowConnection()
VoogaClient
from connection to the server.
protected abstract void initializeConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |