|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object game.net.Client_network_layer
public class Client_network_layer
This class is used by the client to get lines from the network.
Constructor Summary | |
---|---|
Client_network_layer()
Construct a network layer object. |
Method Summary | |
---|---|
boolean |
get_line(java.lang.StringBuffer str_buf)
Attempt to read one line from the server. |
void |
init(java.lang.String server_host_number_or_name,
int server_port)
Initialize the network layer. |
void |
send_line(java.lang.String line)
Send one line to the server. |
void |
shutdown()
Finish everything up |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Client_network_layer()
Method Detail |
---|
public void init(java.lang.String server_host_number_or_name, int server_port) throws java.net.UnknownHostException, java.io.IOException
server_host_number_or_name
- This can be either of the form 134.153.12.70
or of the form peta.engr.mun.ca.server_port
- this is the "well known port number" for the server.
java.net.UnknownHostException
- if the server host can not be found.
java.io.IOException
- if communication with the server can not be initialized.public void send_line(java.lang.String line) throws java.io.IOException
send_line
in interface Client_network_interface
line
- This should end in a newline.
java.io.IOException
- if the line can not be sent.Client_network_interface
public boolean get_line(java.lang.StringBuffer str_buf) throws java.io.IOException
get_line
in interface Client_network_interface
str_buf
- a string buffer onto which the line will be appended if
a line is read. Typically you would pass a new string buffer.
java.io.IOException
- if there was trouble reading the line.Client_network_interface
public void shutdown() throws java.io.IOException
java.io.IOException
- if any trouble ;
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |