/** *Class Sender is a class used for sending messages to the server *Internetprogrammering 1 - Course *@author Martin Carlsson */ import java.net.*; import java.io.*; public class Sender { private PrintWriter out; public Sender(Socket theSocket) { try { out = new PrintWriter(theSocket.getOutputStream(), true); } catch(IOException iE) { } } /*Closes the outgoing stream*/ public void closeOutStream() { if(out != null) out.close(); } /*Sends a message to the server*/ public void sendAway(String s) { if(out !=null) out.println(s); } } // End class Sender