Hi. I am writing a multiplayer chekers game. But i have a problem with networking. I got this error:
java.net.SocketException: Software caused connection abort: socket write error
try {
s = new Socket(this.getCodeBase().getHost(), DEFAULT_PORT);
in = new DataInputStream(s.getInputStream());
out = new DataOutputStream(s.getOutputStream());
listener = new StreamListener(in, button_array);
// Let the user know we are ready
this.showStatus("Connected to "
+ s.getInetAddress().getHostName()
+ ":" + s.getPort());
}
catch (IOException e) { this.showStatus(e.toString()); }
and the other part of the code is...
try{
out.writeInt(c);
d=in.readInt();
System.out.println("-----"+d);
}
catch (IOException e2) {System.out.println(e2.toString()); };
Where am i wrong??