Go Down

Topic: Detect ip of client? (Read 1 time) previous topic - next topic

zoomkat

Quote
If you don't want to be forced to reset your Arduino every few requests you should eliminate the String class from your project.


I've got some simple server code that uses the String class and had the server respond to a client request 500,000+ times with out a crash. Perhaps your code is defective.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

pylon

Quote
I've got some simple server code that uses the String class and had the server respond to a client request 500,000+ times with out a crash. Perhaps your code is defective.


If you are very cautious and know where the class is defective for en embedded environment, this is possible. But generally it's probably the worst decision of the Arduino makers to have this class included in the IDE. The way the OP uses the class he won't be able to answer 500'000 requests. And he does nothing the documentation says you shouldn't do.

zoomkat

#12
Feb 08, 2013, 05:54 pm Last Edit: Feb 08, 2013, 05:56 pm by zoomkat Reason: 1

Quote
I've got some simple server code that uses the String class and had the server respond to a client request 500,000+ times with out a crash. Perhaps your code is defective.


If you are very cautious and know where the class is defective for en embedded environment, this is possible. But generally it's probably the worst decision of the Arduino makers to have this class included in the IDE. The way the OP uses the class he won't be able to answer 500'000 requests. And he does nothing the documentation says you shouldn't do.


Well, guess we will see if the deletion of the String class fixes the OP's issue. Specifically which String useage in the OP's origional posted code is causing his issue? Did the String memory location "go out of scope" in the OP's code? The issue you pointed to (below) may well fix any "bug" issue by emptying the memory location such that there is no longer memory that needs to be freeded in that location. I read closely the anti String posting and don't remember ever actually seeing an issue being fixed by the removal of String useage.  I'll observe to see how this plays out.

Code: [Select]
   String buffer = "";  
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

pylon

Quote
I read closely the anti String posting and don't remember ever actually seeing an issue being fixed by the removal of String useage.


I had several threads where the change from the String class to using character arrays fixed the problems.

Anyway, I didn't say that the line I posted was posing problems for the OP, that was just the indication that he uses the String class. Because I've seen lots of strange behaviors because of the usage of the String class, that's always the first thing I try to eliminate.

zoomkat


Quote
I read closely the anti String posting and don't remember ever actually seeing an issue being fixed by the removal of String useage.


I had several threads where the change from the String class to using character arrays fixed the problems.

Anyway, I didn't say that the line I posted was posing problems for the OP, that was just the indication that he uses the String class. Because I've seen lots of strange behaviors because of the usage of the String class, that's always the first thing I try to eliminate.


Also DO NOT FLY ON AIRPLANES BECAUSE ONE CRASHED ONCE!!! I'm not a programmer, but I do look at the code where the Strings warnings are given, and the code posted usually does not involve the processes that supposedly invoke the "bug" as described by the "bug gurus". Giving String warnings that do not have to do with the issue being discussed is just a red flag for me that the people giving the warnings don't really understand the "bug" that they warning about.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

Go Up