public void run() {
		byte buffer[] = new byte[1024];
		try {
			InputStream is = from_socket.getInputStream();
			OutputStream os = to_socket.getOutputStream();
			do {
				int length = is.read(buffer);
				if (length == -1) {
					String type = name.equals("Send") ? "Client" : "Server";
					System.out.println(String.valueOf(String
							.valueOf((new StringBuffer("  ")).append(type)
									.append(" connection closed."))));
					break;
				}
				log(buffer, length);
				os.write(buffer, 0, length);
			} while (true);
		} catch (SocketException e) {
			System.out.println("  ".concat(String.valueOf(String.valueOf(e
					.getMessage()))));
		} catch (IOException e) {
			System.out.println("  Error: ".concat(String.valueOf(String
					.valueOf(e.getMessage()))));
		} finally {
			try {
				from_socket.close();
				to_socket.close();
			} catch (Exception exception1) {
			}
			if (maxBytesInTraceFile != -1)
				synchronized (traceFileBuffer) {
					pwriter.println(traceFileBuffer.toString());
					traceFileBuffer.setLength(0);
					pwriter.flush();
				}
		}
	}