game.net
Interface Client_network_interface

All Known Implementing Classes:
Client_network_layer

public interface Client_network_interface


Method Summary
 boolean get_line(java.lang.StringBuffer str_buf)
          Attempt to read one line from the server.
 void send_line(java.lang.String line)
          Send one line to the server.
 

Method Detail

send_line

void send_line(java.lang.String line)
               throws java.io.IOException
Send one line to the server.

Parameters:
line - This should end in a newline.
Throws:
java.io.IOException - if the line can not be sent.

get_line

boolean get_line(java.lang.StringBuffer str_buf)
                 throws java.io.IOException
Attempt to read one line from the server. Returns a line when a newline is read, or when its internal buffer is full. The internal buffer holds at least 1001 bytes.

The bytes read are converted to a String according to ASCII encoding.

Byte value 10 is used to mark the end of lines.

Parameters:
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.
Returns:
true if the line was gotten and false otherwise.
Throws:
java.io.IOException - if there was trouble reading the line.