|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmain.Server
public class Server
Chat server runner.
| Field Summary | |
|---|---|
java.util.Hashtable<java.lang.Integer,Conversation> |
convTable
|
java.util.Hashtable<java.lang.String,User> |
userTable
|
| Constructor Summary | |
|---|---|
Server(int port)
Creates a new instance of a server. |
|
| Method Summary | |
|---|---|
void |
freeID(int ID)
Frees an ID that was previously reserved for a conversation, that way they can be reused without restarting the server. |
static void |
main(java.lang.String[] args)
Start a chat server. |
int |
newID()
Generates a new, random ID for a conversation. |
void |
serve()
Waits for clients to connects. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final java.util.Hashtable<java.lang.String,User> userTable
public final java.util.Hashtable<java.lang.Integer,Conversation> convTable
| Constructor Detail |
|---|
public Server(int port)
throws java.io.IOException
port - Port to listen to clients on
java.io.IOException - if a Server Socket cannot be made on the port| Method Detail |
|---|
public void serve()
public int newID()
public void freeID(int ID)
ID - integer ID to free from the list of currently used ID'spublic static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||