|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectctf.network.tcp.Server
public class Server
Used for communication between game and clients
Constructor Summary | |
---|---|
Server(ServerOwner owner)
Default constructor |
Method Summary | |
---|---|
Connection |
accept()
Accepts a connection from a client |
void |
bind(int port)
Start listening for incoming connections |
void |
finalize()
|
void |
startAccepting(int clients)
Starts accepting TCP clients (asynchronously) |
void |
stopAccepting()
Shut down the server port |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Server(ServerOwner owner)
Method Detail |
---|
public void finalize()
finalize
in class java.lang.Object
public void stopAccepting() throws java.io.IOException
java.io.IOException
public void bind(int port) throws java.io.IOException, java.net.UnknownHostException
port
- The TCP port to listen to
java.io.IOException
java.net.UnknownHostException
public void startAccepting(int clients) throws UninitializedSocketException
clients
- How many clients to accept (0 for no limit)
UninitializedSocketException
public Connection accept() throws java.io.IOException, SocketClosedException, UninitializedSocketException
java.io.IOException
SocketClosedException
UninitializedSocketException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |