Hi Folks, looking for some assistance. I am currently using some of the test code with some small modifications to test the client.connect and client.println…specifically…
if (client.available())
{
Serial.println("Inside Loop function now");
for (int i=0;i<50;i++) {
client.println("Ottawa");
Serial.println("Just sent a print to client connection");
delay(1000);
}
}
On my local server, I have the following small java server listening and ready to accept the data from this as follows:
while ((inputLine = in.readLine()) != null) {
out.println(inputLine);
System.out.println("Valueof inputline is " + inputLine);
try { Thread.sleep(1000);
}
catch(Exception e)
{}
}
where in is a bufferedreader on the inputstream.
The issue I am having is that the first two printlns come across fine (in the future it will be sensor data) but after two (sometimes 3 and sometimes 4), I get a socket exception…Exception caught when trying to listen on port 6666 or listening for a connectionjava.net.SocketException: Software caused connection abort: recv failed
Software caused connection abort: recv failed
I have used this small section of code before without difficulty so I’m wondering if my understanding of the println is correct…should I be using write instead?
Thanks for any help,
Scott