|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IServer
Specification of a chat server. A chat server should be able to accept new chat clients, to accept disconnection of chat clients, to send and receive messages from these clients and to give the list of its connected clients.
Method Summary | |
---|---|
boolean |
connect(String username)
Method called by a chat client to connect to this server. |
boolean |
disconnect(String username)
Method called by a chat client when it wants to be disconnected. |
String[] |
getListOfClients()
Method used to retrieve the list of the connected clients. |
IMessage |
getMessage(String username)
Method used to get the last message sent from a chat client to this server. |
void |
sendMessage(String username,
IMessage msg)
Method called by a chat client on the server when the chat client wants to send a new message. |
Method Detail |
---|
boolean connect(String username)
username
- The username of the client that wants to connect.
boolean disconnect(String username)
username
- The username of the chat client that wants to
be disconnected.
void sendMessage(String username, IMessage msg)
username
- The username of the client that sends this
message.msg
- The IMessage
to send.IMessage getMessage(String username)
username
- The username of the client that wants to get
the last message sent.
IMessage
sent.String[] getListOfClients()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |