BinarySurfer, I have followed your suggestions but it just hangs now. I added those methods to the Server class and i assume that the ServerThread class isn't even used anymore right and that the client stays the same?
Here is the code i have after making those changes.
Server class
import java.net.*;
import java.io.*;
//import java.net.*;
public class Server
{
private static Socket connection;
private static ObjectOutputStream output;
private static ObjectInputStream input;
public static void main(String[] args) throws java.io.IOException
{
ServerSocket s = new ServerSocket(1234);
while(true)
{
connection = s.accept();
System.out.println("client connected");
streams();
send("Send this to client");
//System.out.println("Listenning...");
//(new ServerThread(s.accept())).start();
//System.out.println("Spawned Thread.");
} // end while
} // end main
// establish the streams
private static void streams() throws IOException
{
output=new ObjectOutputStream(connection.getOutputStream());
output.flush();
input=new ObjectInputStream(connection.getInputStream());
} // end streams
private static void send(String or_variable)
{
try
{
output.writeObject("String" + or_variable);
output.flush();
} // end try
catch(IOException ioException)
{
}
} // end send
} // end Server
Client class
import java.io.*;
import java.net.*;
import java.util.*;
public class Client {
public static void main(String[] args) throws IOException
{
Socket skt1 = new Socket("192.168.1.102", 1234);
PrintWriter out = new PrintWriter(skt1.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(
skt1.getInputStream()));
BufferedReader keyInput = new BufferedReader(new InputStreamReader(System.in));
Random r = new Random();
int[] ar = new int[10];
for (int i = 0; i < 10; i++)
ar[i] = r.nextInt(10);
String line = "Send this to the other client";
while(true)
{
try
{
// line = in.readLine();
System.out.println("Enter something");
out.println(keyInput.readLine());
System.out.println(in.readLine());
//out.println(line);
for (int i = 0; i < 10; i++)
System.out.print(ar[i] + " ");
System.out.println();
} // end try
//catches bad user input and throws exception
catch (NumberFormatException ex)
{
System.out.print("Error bad data: ");
} // end catch
} // end while
} // end main
} // end Client