I was hoping that someone could help me with an error I'm having with a java Server program. When trying to send data to client, I receive an error.
Quote:
|
Software caused connection abort: socket write
|
Part of the code that attempts to write something to the OutputStream.
Setup:
Code:
BufferedReader inputFromClient;
ObjectOutputStream outputToClient;
System.out.println("SERVER THREAD INITIATED. CONNECTION = " + this.clientSocket.getInetAddress());
inputFromClient = new BufferedReader(new InputStreamReader(this.clientSocket.getInputStream()));
outputToClient = new ObjectOutputStream(this.clientSocket.getOutputStream());
String message = inputFromClient.readLine();
Sending:
Code:
synchronized(theResult) {
System.out.println("Its inside the synchronized");
String outMessage = finals;
System.out.println(outMessage);
theResult.setMessage(outMessage);
outputToClient.writeObject(theResult);
outputToClient.reset();
}
If anyone can help me ASAP please