|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ServerConnection
Generic interface for some kind of connection to the server, must provide only the most basic functionality.
| Method Summary | |
|---|---|
void |
connect(String newHost,
int port,
String newZone)
Connect to a game server |
void |
disconnect()
Disconnect. |
String |
getHost()
|
int |
getPort()
|
String |
getZone()
|
com.google.gwt.json.client.JSONValue |
readMessage()
Retrieve the next message from the server's queue, or null if there are no messages waiting |
com.google.gwt.json.client.JSONObject |
readMessageBlocking()
Retrieves the next message from the server, blocking to wait for one if there are none queued. |
void |
sendMessage(com.google.gwt.json.client.JSONObject jso)
Send a message to the server |
| Method Detail |
|---|
void connect(String newHost,
int port,
String newZone)
throws IOException,
ServerDisconnectedException
newHost - host name or IP address (in whatever notation the
local networking code understands)port - TCP (or UDP…?) port numbernewZone - the zone on that port, to which to connect ($Eden
is login zone)
IOException - if some kind of problem prevents a
connection; subclasses might make sense to the local
code, to be able to provide better diagnostic
information for the end-user
ServerDisconnectedException - if the connection is lost
(but was basically established)void disconnect()
String getHost()
int getPort()
String getZone()
com.google.gwt.json.client.JSONValue readMessage()
throws ServerDisconnectedException
ServerDisconnectedException - if the connection is lost
com.google.gwt.json.client.JSONObject readMessageBlocking()
throws ServerDisconnectedException
ServerDisconnectedException - if the connection is lost
void sendMessage(com.google.gwt.json.client.JSONObject jso)
throws ServerDisconnectedException
jso - JSON data
ServerDisconnectedException - if the connection is lost
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||