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.
-
PO_NetClient(String, int)
-
Constructor of a PO_NetClient
-
closeConnection(Socket)
-
Closes the network connection
-
DEBUG(String)
-
Debug
Prints debugging statements if the debug flag is set to true
-
openConnection()
-
Method that opens a socket connection to the designated server.
-
sendString(String)
-
Sends the message to the pre-designated network server
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
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
closeConnection
public void closeConnection(Socket netSocket)
- Closes the network connection
sendString
public void sendString(String message)
- Sends the message to the pre-designated network server
- Parameters:
- message - Message to be sent
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