Hello, I am unable to output my line objects from client to server to output it to every other client. I've tried to make it several times in many different ways but always i get some errors. Currently my client says: invalid type code: AC while server says Software caused connection abort: socket write error. I've tried to google for help but never fount anything useful. So the aim of my small project is to send lines drawed on screen to other clients so they can draw with other clients. I've done everything with drawing but sending data is the problem. I dont understand whats wrong. I think its about that it tries to read data thats no available or something, i've tried to make it check if data is available but then nothing happens. Can someone point me out with this?

Client
Java Code:
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JPanel;


public class objectOvetClient extends JPanel implements MouseListener, MouseMotionListener{
	List<line> lines = new ArrayList<line>();
	public static void main(String args[]){
		new objectOvetClient();
	}
	ObjectInputStream ois;
	ObjectOutputStream oos;
	objectOvetClient(){
		try {
			Socket s = new Socket("localhost", 1234);
			ois = new ObjectInputStream(s.getInputStream());
			oos = new ObjectOutputStream(s.getOutputStream());
			new worker().start();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		JFrame frame = new JFrame();
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setContentPane(this);
		addMouseListener(this);
		addMouseMotionListener(this);
	}
	public void paintComponent(Graphics g){
		super.paintComponent(g);
		for(line x: lines){
			g.drawLine(x.x, x.y, x.endX, x.endY);
		}
	}
	class worker extends Thread{
		public void run(){
			while(true){
			try {
				oos.writeObject(lines);
				lines = (ArrayList<line>)ois.readObject();
			} catch (IOException e) {
				e.printStackTrace();
			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			}
			}
		}
	}
	@Override
	public void mouseClicked(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mousePressed(MouseEvent me) {
		lx = me.getX();
		ly = me.getY();
	}
	@Override
	public void mouseReleased(MouseEvent me) {
		lx = 0; ly = 0;
		repaint();
	}
	int lx, ly;
	@Override
	public void mouseDragged(MouseEvent me) {
		if(lx != 0 && ly != 0){
		lines.add(new line(lx, ly, me.getX(), me.getY()));
		lx = me.getX();
		ly = me.getY();
		}
		repaint();
	}
	@Override
	public void mouseMoved(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
}

server
Java Code:
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;


public class objectsOverInternet {
	List<Socket> so = new ArrayList<Socket>();
	List<line> lines = new ArrayList<line>();
	public static void main(String args[]){
		new objectsOverInternet();
	}
	objectsOverInternet(){
		ServerSocket ss = null;
		try {
			ss = new ServerSocket(1234);
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		while(true){
		try {
			Socket s = ss.accept();
			new worker(s).start();
			so.add(s);
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		}
	}
	class worker extends Thread{
		Socket s;
		worker(Socket s){
			this.s = s;
		}
		public void run(){
			sendAll();
			ObjectInputStream ois = null;
			try {
				ois = new ObjectInputStream(s.getInputStream());
			} catch (IOException e) {
				e.printStackTrace();
			}
			while(true){
				try {
					lines.addAll((ArrayList<line>) ois.readObject());
					System.out.println("lines added");
					sendAll();
				} catch (IOException e) {
					e.printStackTrace();
					this.stop();
				} catch (ClassNotFoundException e) {
					e.printStackTrace();
					this.stop();
				}
			}
		}
	}
	public void sendAll(){
		for(Socket x: so){
			try {
				ObjectOutputStream oos = new ObjectOutputStream(x.getOutputStream());
				oos.writeObject(lines);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
line object to store data:
Java Code:
import java.io.Serializable;

	class line implements Serializable{
		int x, y, endX, endY;
		line(int x, int y, int endX, int endY){
			this.x = x;
			this.y = y;
			this.endX = endX;
			this.endY = endY;
		}
	}
Please help me guys!