package sock; import java.io.*; import java.net.*; import java.awt.event.ActionEvent; public class ClientSocket implements Serializable { private Socket client; private DataInputStream in = null; private PrintStream out = null; private int port = -1; // PROPERTY private String machine = "127.0.0.1"; // PROPERTY public void connect() throws IOException, UnknownHostException { if (port == -1) return; // do nothing if no port // connect to host at port ... // open input and output streams ... } public void writeln(String s) { // write to the output stream } public String readln() throws IOException { // read and return data from input stream } // // other methods depending on design ... // }