Class PO_NetClient

Class PO_NetClient

java.lang.Object
   |
   +----PO_NetClient

public class PO_NetClient
extends Object
PO_NetClient Class This is a class which handles network socket connections and closings. It is also where the remote server and port number is specified.

Constructor Index

 o PO_NetClient(String, int)
Constructor of a PO_NetClient

Method Index

 o closeConnection(Socket)
Closes the network connection
 o DEBUG(String)
Debug Prints debugging statements if the debug flag is set to true
 o openConnection()
Method that opens a socket connection to the designated server.
 o sendString(String)
Sends the message to the pre-designated network server

Constructors

 o PO_NetClient
  public PO_NetClient(String server,
                      int port)
Constructor of a PO_NetClient
Parameters:
server - The name of the server to connect to
port - The port of the server to connect to

Methods

 o openConnection
  public Socket openConnection()
Method that opens a socket connection to the designated server. (set to yoyodyne.eecs.berkeley.edu, port 701x right now) Returns a socket if connection is completed, null if not. Server and port number should/could be passed in in the future
 o closeConnection
  public void closeConnection(Socket netSocket)
Closes the network connection
 o sendString
  public void sendString(String message)
Sends the message to the pre-designated network server
Parameters:
message - Message to be sent
 o DEBUG
  protected static void DEBUG(String debugStmt)
Debug Prints debugging statements if the debug flag is set to true
Parameters:
debugStmt - The debugging statement supplied