All pastes #580716 Raw Edit

Unnamed

public java v1 · immutable
·published 2007-06-21 06:21 UTC
rendered paste body
package connection;import java.net.*;import javax.swing.*;import java.io.*;public class Client {	private Socket socket;	private PrintWriter out;	private BufferedReader in;	private ClientReader cr;		public Client(String addr, int port, JTextArea txtChatArea) throws IOException {		socket = new Socket(addr, port);				out = new PrintWriter(socket.getOutputStream(), true);        in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "8859_1"));                cr = new ClientReader(in, txtChatArea);	}	public String toString() {		return socket.toString();	}	public boolean send(String str) {		try {			out.println(str);		}		catch(Exception e) {			return false;		}				return true;	}	protected void finalize() {		try {			out.flush();			out.close();			in.close();						socket.close();		}		catch(IOException e) { }	}}/*BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), "8859_1"));*/